Вот мой код файла ts: я использую angular7 with "ng2-file-upload": "^1.3.0",
constructor(private store:Store<StateSetupConfig>,
private changeDetector: ChangeDetectorRef) {
this.fileUploader = new FileUploader(
{
allowedFileType:this.allowedFileType,
maxFileSize: this.singleMaxFileSize,
queueLimit : this.queueLimit,
removeAfterUpload: true,
autoUpload: true,
});
this.fileUploader.onWhenAddingFileFailed = (item, filter, options) => this.onWhenAddingFileFailed(item, filter, options);
this.fileUploader.onProgressItem = (progress:any) => this.changeDetector.detectChanges();
this.fileUploader.onProgressItem = (fileItem:FileItem, progress:any) => {
console.log('progress', progress); only getting 0
}
}
Когда я загружаю только файл, я получаю прогресс как 0. Нет обновлений, которые я получаю в процессе загрузки.Кто-нибудь поможет мне разобраться в проблеме с моим кодом?
Заранее спасибо.