TCB MediaList Component
The CmsMediaListComponent allows users to select or upload media files, sending them to the backend via MediaService. It emits selected or uploaded media through the select event and supports toggling between different view layouts.
How to use the component in your app :
import the component :
import { CmsMediaListComponent } from '@tradinos/cms-frontend-media';The selector for component , like it :
<lib-cms-media-list></lib-cms-media-list>Features
Media Selection
Allows users to browse and select media files from a list.
Emits the selected media file to parent components for further processing.
File Uploading
Supports uploading new media files through an integrated file input.
Automatically uploads the selected file to the server and emits the uploaded file.
Event-Driven Communication
Emits events when a file is selected or uploaded, facilitating seamless interaction with parent components.
Custom View Toggle
Provides a boolean property (
customViewChecked) to toggle between different media list views.
Backend Integration
Utilizes the
MediaServiceto handle API requests for uploading media to the backend.
Reactive Design
Reactive programming approach using Angular's
EventEmitterfor efficient communication.
Outputs
Output
Type
Description
select
EventEmitter<Media>
Emits the selected media item when a user selects an existing media.
Methods
Method
Description
onSelect(media)
Emits the selected media object using the select event.
onFileSelected(event)
Uploads the selected file via mediaService and emits the response data.
Last updated