22 lines
530 B
TypeScript
22 lines
530 B
TypeScript
|
import {Component} from '@angular/core';
|
||
|
import {MessageService} from 'primeng/api';
|
||
|
|
||
|
@Component({
|
||
|
templateUrl: './filedemo.component.html',
|
||
|
providers: [MessageService]
|
||
|
})
|
||
|
export class FileDemoComponent {
|
||
|
|
||
|
uploadedFiles: any[] = [];
|
||
|
|
||
|
constructor(private messageService: MessageService) {}
|
||
|
|
||
|
onUpload(event) {
|
||
|
for (const file of event.files) {
|
||
|
this.uploadedFiles.push(file);
|
||
|
}
|
||
|
|
||
|
this.messageService.add({severity: 'info', summary: 'Success', detail: 'File Uploaded'});
|
||
|
}
|
||
|
}
|