【发布时间】:2017-08-19 01:43:49
【问题描述】:
我想将一个文件的名称从我可以发出输出并发送到另一个组件的函数中发送出去。我尝试了一个原型,但我无法解决它。
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);
}
【问题讨论】:
标签: angular typescript meteor