gpt4 book ai didi

angular - 错误 TS2339 : Property 'email' does not exist on type 'Object'

转载 作者:太空狗 更新时间:2023-10-29 17:03:42 25 4
gpt4 key购买 nike

我正在使用 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;
})
}

错误是:

src/app/authentification/authentification.component.ts(34,28): error TS2339: Property 'email' does not exist on type 'Object'. src/app/authentification/authentification.component.ts(35,25): error TS2339: Property 'last_name' does not exist on type 'Object'. src/app/authentification/authentification.component.ts(36,28): error TS2339: Property 'first_name' does not exist on type 'Object'. src/app/authentification/authentification.component.ts(37,34): error TS2339: Property 'image' does not exist on type 'Object'.

最佳答案

将第 3 行的 (data) 替换为 (data : any)

关于angular - 错误 TS2339 : Property 'email' does not exist on type 'Object' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48539216/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com