我现在有一个需求
let subIntance = this.fileChangeObs
.pipe(map((evt: any) => {
return from(this.fileToUrl(evt.target.files[0]));
})).subscribe((res) => {
console.log(res);
subIntance.unsubscribe();
});
怎么样在subscribe时得到一个字符串而不是一个Observable
求帮助,谢谢!
this.fileToUrl(evt.target.files[0]) => Promise<string>
this.fileChangeObs: Observable<Event>