item;//item={name:""}this.itemService.getItemByOem(this.oem).then((e)=>{ this.item=e['item'];
this.user=e['user']; this.loader.dismiss();
})getItemByOem(oem): Promise<any[]> { return this.http.get(this.baseUrl+"/"+oem,{headers: this.headers})
.toPromise()
.then(response => response.json())
.catch(this.handleError);
}模版中直接{{item.name}是报错的,js输出到控制台却有值,{{item | json}}里也是有name的除非我在开头直接先定义 item={name:""},这样才正常
添加回答
举报
0/150
提交
取消