订阅不存在于类型';AngularFireObject<;简介>';
因此,我将在udemy上学习本教程。应用程序有一个配置文件页面,您可以在其中查看用户名和内容 在我的提供商中,我做:订阅不存在于类型';AngularFireObject<;简介>';,angular,typescript,firebase,ionic-framework,angularfire2,Angular,Typescript,Firebase,Ionic Framework,Angularfire2,因此,我将在udemy上学习本教程。应用程序有一个配置文件页面,您可以在其中查看用户名和内容 在我的提供商中,我做: profileObject: AngularFireObject constructor(private database: AngularFireDatabase ) { } async saveProfile(user: User, profile: Profile) { this.profileObject= this.database.object(/pro
profileObject: AngularFireObject
constructor(private database:
AngularFireDatabase ) { }
async saveProfile(user: User, profile: Profile) {
this.profileObject= this.database.object(/profiles/${user.uid});
try {
this.profileObject.set(profile);
return true
} catch (e) {
console.error(e);
return false;
}
}
在我的纵断面图组件中,我会:
ngOnInit(): void {
this.auth.getAuthenticatedUser().subscribe((user: User) => {
this.data.getProfile(user).subscribe((profile: Profile) => {
this.userProfile = profile;
})
})
但我发现类型“AngularFireObject”上不存在错误订阅。
有什么解决方法吗?您正在调用
getProfile
,但是您已经显示了saveProfile
的代码。。您需要提供正在调用的正确代码getProfile
,但您已经显示了saveProfile
的代码。。您需要提供正确的代码