我正在尝试将可观察到的字符串转换为用于Firestore的纯字符串。
尝试过foreach方法
this.snapshot = this.task.snapshotChanges().pipe(
tap(snap => {
if (snap.bytesTransferred === snap.totalBytes) {
// Update firestore on completion
this.afs.collection('logos').add({ path, size: snap.totalBytes });
}
}),
finalize(() => this.logoURL = this.storage.ref(path).getDownloadURL() )
this.logoURL.forEach(value => { this.imagePath = value.toString(); }
我想从logoUrl获取值并将其存储在imagePath中
谢谢
答案 0 :(得分:0)
this.snapshot = this.task.snapshotChanges().pipe(
tap(snap => {
if (snap.bytesTransferred === snap.totalBytes) {
// Update firestore on completion
this.afs.collection('logos').add({ path, size: snap.totalBytes });
}
}),
finalize(() => {
this.logoURL = this.storage.ref(path).getDownloadURL();
this.logoURL.subscribe(val => {
this.imagePath = val;
});
})
);