upload/src/upload/upload.component.ts
Upload component provides a drop area and file selection dialog to pick files for upload. It also displays a list of selected files along with their upload status, file name and size.
Upload component allows controlling accepted file types, maximum number of files, maximum file size and maximum overall upload size. It also provides user feedback through warning messages when files are rejected due to validation failures.
Use UploadService to access/manage the list of selected files and to update their upload status.
Example :@Component({
template: `<talenra-upload />`,
imports: [UploadComponent],
providers: [{ provide: UploadService, useClass: UploadService }]
...
})
export class ConfigurableUploadComponent {
private uploadService: UploadService = inject(UploadService);
...
}import { UploadComponent } from '@talenra/components/upload';See UploadService See IUploadItem See UploadState See IUploadMessages
| changeDetection | ChangeDetectionStrategy.OnPush |
| host | { |
| selector | talenra-upload |
| imports |
FileListComponent
IconComponent
|
| templateUrl | ./upload.component.html |
| styleUrl | ./upload.component.scss |
Inputs |
| customMessages |
Type : Partial<IUploadMessages>
|
|
Custom messages/translations will override default messages provided via localize. Use this feature if your app involves multiple instances of Upload using different messages per instance. If all Upload instances of your app share the same messages, you should provide/customize messages via localization instead. Custom messages can be translated using the |
| dropAreaIcon |
Type : string
|
Default value : 'upload-file'
|
|
Name of the icon to display in upload's drop area. Expects a valid icon name as used in IconComponent. Example : |
| maxFiles |
Type : number, unknown
|
Default value : MAX_FILES_DEFAULT
|
|
Maximum number of files to be uploaded. Example : |
| unit |
Type : TMemorySize | undefined
|
|
Unit used in file listing for file sizes. If omitted, the most appropriate unit is used. Example : |