【发布时间】:2020-10-02 11:45:21
【问题描述】:
所以我能够成功地将图像上传到 FireStore 存储。
现在我正在尝试将存储在 FireStore 中的图像应用到应用程序上的用户配置文件中。
import {ActivatedRoute} from '@angular/router';
import { AngularFireStorage } from 'angularfire2/storage';
export class ProfileComponent implements OnInit {
routeParams;
profilePicture: any = "../../assets/default-img.png"
constructor(
private afStorage: AngularFireStorage,
private route: ActivatedRoute,
) { }
ngOnInit()
{
this.routeParams = this.route.params.subscribe(
params => {
/*Update Variables here*/
if (email.__email != "")
{
let path = "/" + email.__email + "/profile.png";
this.profilePicture = this.afStorage.ref(path).getDownloadURL();
}
});
}
}
我要做的就是从 FireStore 存储中检索 img 并将其应用到一个人的个人资料图片。
【问题讨论】:
标签: angular typescript firebase google-cloud-firestore