Должна ли длина наследоваться от углового, правого?и почему если (fileList.length> 0) MyPostsComponent.html: 7 ОШИБКА TypeError: Невозможно прочитать «длину» неопределенного свойства.
onFileSelection(event){
const fileList: FileList = event.target.filse;
if (fileList.length > 0){
const file: File = fileList[0];
this.myFire.uploadFile(file).then(data => {
//TO DO
this.notifier.display('success','Picture Uploaded!');
console.log(data['fileUrl']);
})
.catch(err => {
this.notifier.display('error', err.message);
});
}
}
в моем HTML-коде
<input type="file" (change)="onFileSelection($event)" placeholder="Upload a file" accept=".png, .jpeg, .jpg">