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 :

  1. import the component :

import { CmsMediaListComponent } from '@tradinos/cms-frontend-media';
  1. The selector for component , like it :

<lib-cms-media-list></lib-cms-media-list>

Features

  1. Media Selection

    • Allows users to browse and select media files from a list.

    • Emits the selected media file to parent components for further processing.

  2. 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.

  3. Event-Driven Communication

    • Emits events when a file is selected or uploaded, facilitating seamless interaction with parent components.

  4. Custom View Toggle

    • Provides a boolean property (customViewChecked) to toggle between different media list views.

  5. Backend Integration

    • Utilizes the MediaService to handle API requests for uploading media to the backend.

  6. Reactive Design

    • Reactive programming approach using Angular's EventEmitter for 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