html file
志愿者评选
{ {volunteer.title}}
ts file
import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
@Component({
selector: 'page-volunteer-vote-detail',
templateUrl: 'volunteer-vote-detail.html',
})
export class VolunteerVoteDetailPage {
volunteer:any;
constructor(public navCtrl: NavController, public navParams: NavParams) {
this.volunteer = navParams.get('volunteer');
}
}
在其他页面中,我使用 this.volunteer = navParams.get('volunteer'); 获取数据,但这里无法获取数据并显示错误
Error:
错误错误:未捕获(在承诺中):TypeError:无法读取未定义的属性'title'TypeError:无法在Object.eval [as updateRenderer](VM3975 VolunteerVoteDetailPage.ngfactory.js:64)处读取未定义的属性&