我在ionic的移动应用程序中工作,我必须将变量推送到另一个页面
我已尝试使用推送,但出现错误:'NavController‘类型上不存在属性’NavController.push‘
<ion-card (click)="passVar(item.HISTO_N)" *ngFor="let item of items">
<ion-card-header>
<ion-card-title #HISTO_N>Intervention n° {{item.HISTO_N}}</ion-card-title>
</ion-card-header>
<ion-card-content style="margin-top: 10px;">
<p style="text-decoration: underline;margin-top: 10px;">Adresse :</p><p [innerHTML]="item.L4_Livraison"><br></p>
<p style="text-decoration: underline;margin-top: 10px;">Date : </p><p [innerHTML]="item.HISTO_Date1"></p>
<p style="text-decoration: underline;margin-top: 10px;">Consigne : </p><p [innerHTML]="item.HISTO_Comm1"><br></p>
<ion-button float-right fill="clear" *ngIf="item.HISTO_Objet2 == null" color="warning">
<ion-icon name="information-circle"></ion-icon> Etat non renseigné
.
.
.
.
</ion-card>
passVar(HISTO_N) {
HISTO_N = HISTO_N || 'ERROR NO VAR';
this.navCtrl.push(Tab1Page, {
data: HISTO_N
});
console.log(HISTO_N);
}
发布于 2019-09-06 14:14:45
Ionic 4+不再支持pust pop
导航,它现在使用Angular Router。
如果您想在ionic 4+中使用路由,并学习如何传递参数和所有有用的东西,请尝试使用它们的blog post了解由于路由而发生的更改。
https://stackoverflow.com/questions/57823184
复制相似问题