這是我的陣推:離子2 - 返回[對象,對象]
let results = this.allExercises[i];
this.dataArray.push(results);
我給一個頁面推送這樣navParams:
this.navCtrl.push(HomePage, {
'exercisesDone': this.dataArray
});
我在我的主頁上這樣的檢索它們:
constructor(public navCtrl: NavController, public params:NavParams) {
if(params.get("exercisesDone")){
this.exerciseIsDone = params.get("exercisesDone");
console.log('exerciseDone: ', this.exerciseIsDone);
}
}
而且在我的html我這樣做:
<p>{{ exerciseIsDone }}</p>
<div *ngFor="let b of exerciseIsDone; let i = index">{{ b }}</div>
以此爲結局:
<p>[object Object], [object Object],[object Object]</p>
<div>[object Object]</div>
<div>[object Object]</div>
如何打印數組的值?
'{{b.exercise}}' – yurzui