html页面引入ts文件,如何将ts文件中收到的参数显示到html页面

我是离子框架的新手。在这里,我试图在新页面中显示从主页收到的参数。我尝试了以下代码。但目前没有任何显示。任何人都可以告诉我我错过了什么。如何将ts文件中收到的参数显示到html页面

谢谢。

about.ts

export class AboutPage {

userProfile: any = null;

constructor(public navCtrl: NavController, public navParams: NavParams) {

this.userProfile = navParams.get("userProfile");

}

ionViewDidLoad() {

console.log('ionViewDidLoad AboutPage');

}

goBack() {

this.navCtrl.pop();

}

}

about.html

This is About Us Page.

{{ userProfile.displayName }}

The UID for this new user is {{userProfile.uid}} and the email is {{userProfile.email}}

2017-08-05

S S

+0

“navParams”的代码是什么样的?你确定它正在返回你期望的对象吗? –

+0

@Claies是的,我得到像这样的价值“{”uid“:”121221“,”displayName“:”测试用户“,”photoURL“:”https://scontent.xx.fbcdn.net/v/t1 .0-1/s100x100/13891932_1288454467839950_3149500025504162596_n.jpg? –

+0

我明白我的错误。我必须对此数据执行JSON.parse –

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值