0
我想發送一個文件的名稱出我可以發出輸出併發送到另一個組件的函數。我嘗試了一個原型,但我無法解決它。如何發送匿名函數變量的內容
file(file: File): void {
UploadFS.selectFiles(function(file){
var today = new Date();
var dd = today.getTime();
let photo = {
name: file.name + dd,
size: file.size,
type: file.type
};
let worker = new UploadFS.Uploader({
store: ImagesStore,
data: file,
file: photo,
onComplete(file) {
console.log(file.name + ' has been uploaded');
this.check = file.name;
}
});
worker.start();
this.check = photo.name;
console.log(photo.name); //here the name of file is visible
});
console.log("check outside33 ",this.check); // here not: output: undefinded
//this.onFile.emit(this.check);
}
謝謝!這是工作 – beciaha