more页面中 userInfo定义没有赋值. 老师项目里面可以直接使用, 我项目中为提示userInfo为undefined
来源:6-8 用户登录后的页面建立与逻辑添加
qq_时间倒回去浮华不堪_0
2018-02-13
前台页面调用:
{{userInfo.UserNickName}}
写回答
1回答
-
qq_时间倒回去浮华不堪_0
提问者
2018-02-13
后台代码:
userInfo: string[]; ionViewDidEnter () { this.loginStatus(); } loginStatus () { let $this = this; this.storage.get('UserId') .then((val) => { if (val != null) { let loader = super.load(this.loadCtrl, '加载中...'); this.rest.getUserInfo(val) .subscribe(data => { this.userInfo = data; this.headface = `${this.userInfo['UserHeadface']}?r=${new Date().valueOf()}`; $this.unlogin = false; $this.logined = true; loader.dismiss() }) } else { $this.unlogin = true; $this.logined = false; } }) }
112018-02-16
相似问题