【发布时间】:2016-09-26 17:46:33
【问题描述】:
我已经使用 http 调用获取数据。但是,我在编译时显示了上述错误。
user.component.ts
this._user.saveUsers(model).then(data => {
if(data.success==true){
this.router.navigate(['/user/list']);
}else{
console.log("data")
}
});
注意:我的对象是动态的。取决于我的 http 调用
错误:
app/users/users.component.ts(33,21):错误 TS2339:类型“{}”上不存在属性“成功”。 app/users/users.component.ts(34,38):错误 TS2339:类型“{}”上不存在属性“数据”。 app/users/users.component.ts(76,25):错误 TS2339:类型“{}”上不存在属性“成功”。
【问题讨论】:
-
this._user.saveUsers(model).then(data => { console.log(data)})check n 告诉你在控制台得到了什么???
标签: angular typescript