0
我有一個非常簡單的情況與此HTML:離子 - this.navCtrl.push不工作
<!--
Generated template for the FormulasPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar>
<ion-title>Formulas</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<div class="formula" *ngFor="let j of items ; let i = index" id='{{i}}' (tap)="loadFolder(j.color)" no-lines no-padding>
<ion-grid>
<ion-row>
<ion-col>
<img src="{{j.url}}">
<div class="formulabar" #formulabar>{{j.color}}</div>
</ion-col>
</ion-row>
</ion-grid>
</div>
</ion-content>
相關部分是(tap)
處理器上div.formula
。這是一個涉及代碼:
loadFolder(color) {
console.log("load folder");
console.log(color);
this.navCtrl.push(FormulaPage);
}
控制檯消息發生 - "load folder"
,但頁面不改變。
是否在app.module.ts聲明和entryComponents中聲明瞭formulapage? –