【发布时间】:2019-09-07 05:02:07
【问题描述】:
我正面临在离子视图中显示数据的问题。 我已经尝试了一些代码。它还没有工作。当我在 ts 文件上打印出 $person 时,我得到了 [object Object]。我的 json obj 就像 {"user_name":"user123", "full_name": "yiemon", "email":"yiemon@gmail.com"}。请帮帮我。
这是我的 menu.ts
async ionViewWillEnter() {
this.person$ = from(this.authService.getProfile().then((res) => {
this.authService.setProfile(res.data);
console.log(res.data);
return res.data;
}));
console.log("User_"+this.person$);
//this.username=this.authService.userProfile.username;
}
这是我的 menu.html
<ion-col class="menu_bottom" >
<!-- {{(person$ | async)?.user_name}} -->
<!-- {{person$.user_name}} -->
{{person$?.user_name}}
</ion-col>
【问题讨论】:
标签: cordova ionic-framework node-modules