我已经使用 http 调用获取数据。但是,我在编译时显示了上述错误。
用户组件.ts
this._user.saveUsers(model).then(data => {
if(data.success==true){
this.router.navigate(['/user/list']);
}else{
console.log("data")
}
});
Note:我的对象是动态的。取决于我的http调用
Error:
app/users/users.component.ts(33,21):错误 TS2339:类型“{}”上不存在属性“成功”。 app/users/users.component.ts(34,38):错误 TS2339:类型“{}”上不存在属性“数据”。 app/users/users.component.ts(76,25):错误 TS2339:类型“{}”上不存在属性“成功”。
我不知道第 33 行和第 34 行,因为它们没有显示在您的代码中,但对于第 76 行,您必须输入
data: any
Or
data: {success: any}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)