如何将字符串对象分配给可观察对象<string>



我正在尝试将可观察到的字符串转换为用于 firestore 的纯字符串。

已尝试每种方法

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 中

谢谢

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;
        });
      })
    );

最新更新