Cordova 检索数据后,数据未显示在“离子视图”页面上
我面临着在ionic中显示视图数据的问题。 我试过一些代码。它还没起作用。当我在ts文件上打印$person时,我得到了[object]。我的json obj类似于{“用户名”:“user123”,“全名”:“yiemon”,“email”:yiemon@gmail.com“}请帮帮我 这是我的菜单Cordova 检索数据后,数据未显示在“离子视图”页面上,cordova,ionic-framework,node-modules,Cordova,Ionic Framework,Node Modules,我面临着在ionic中显示视图数据的问题。 我试过一些代码。它还没起作用。当我在ts文件上打印$person时,我得到了[object]。我的json obj类似于{“用户名”:“user123”,“全名”:“yiemon”,“email”:yiemon@gmail.com“}请帮帮我 这是我的菜单 async ionViewWillEnter() { this.person$ = from(this.authService.getProfile().then((res) =>
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;
}
这是我的菜单.html
<ion-col class="menu_bottom" >
<!-- {{(person$ | async)?.user_name}} -->
<!-- {{person$.user_name}} -->
{{person$?.user_name}}
</ion-col>
{{person$?.user_name}
解析JSON对象并以{{userProfile.user_name}的方式调用数据后,数据出现