Ionic framework 来自JSON数组的Ionic 3 navPush
我在我的Ionic应用程序中有一个根页面,我是从JSON文件构建的。我需要在数组中放置一个页面对象,让navPush选择器获取该值,但它不起作用。如果我将一个页面硬编码到navPush中,它会工作,但从JSON中提取时不会工作 列表页面Ionic framework 来自JSON数组的Ionic 3 navPush,ionic-framework,ionic3,Ionic Framework,Ionic3,我在我的Ionic应用程序中有一个根页面,我是从JSON文件构建的。我需要在数组中放置一个页面对象,让navPush选择器获取该值,但它不起作用。如果我将一个页面硬编码到navPush中,它会工作,但从JSON中提取时不会工作 列表页面 ... <ion-row class="grid-categories"> <ion-col width-50 class="category-item" *ngFor="let category of listing.categories
...
<ion-row class="grid-categories">
<ion-col width-50 class="category-item" *ngFor="let category of listing.categories">
<background-image class="category-heading" [src]="category.image" [navPush]="category.page">
<ion-row class="heading-row">
<ion-col no-padding width-100>
<h2 class="category-title">{{category.title}}</h2>
</ion-col>
</ion-row>
</background-image>
</ion-col>
</ion-row>
...
它不应该是
“页面”:“AboutPage”
?(类名大写A)
...
"categories": [
{
"title": "About MSNVM",
"image": "./assets/images/listing/200x200basquet.png",
"page": "aboutPage"
},
{
"title": "Plaque Locator",
"image": "./assets/images/listing/200x200boxeo.png",
"page": "aboutPage"
},
{
"title": "Make A Donation",
"image": "./assets/images/listing/200x200crossfit.png",
"page": "aboutPage"
},
{
"title": "Visit Memorial",
"image": "./assets/images/listing/200x200futbol.png",
"page": "aboutPage"
}
]
...