12 angular
我正在使用角度5,我得到一个错误,继承人的代码:
signIn(provider) {
this._auth.login(provider).subscribe(
(data) => {
console.log(data);
this.hideForm = false;
this.emaill = data.email;
this.nom = data.last_name;
this.prenom = data.first_name;
this.profileImage = data.image;
})
}
Run Code Online (Sandbox Code Playgroud)
错误是:
src/app/authentification/authentification.component.ts(34,28):错误TS2339:"对象"类型上不存在属性"电子邮件".src/app/authentification/authentification.component.ts(35,25):error TS2339:类型'Object'上不存在属性'last_name'.src/app/authentification/authentification.component.ts(36,28):error TS2339:类型'Object'上不存在属性'first_name'.src/app/authentification/authentification.component.ts(37,34):错误TS2339:属性'对象'上不存在属性'图像'.
Nut*_*tan 51
替换(data)为(data : any)第3行.