"v.context.$ implicit.categories [0]未定义". Ionic 3中的错误 [英] "v.context.$implicit.categories[0] is undefined" error in Ionic 3
本文介绍了"v.context.$ implicit.categories [0]未定义". Ionic 3中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用WordPress rest API访问离子产品的类别标签.在<h3 class="product-name uppercase">{{productdetail?.categories[0].slug}}</h3>
上这似乎在一页上可以正常工作,但是当我尝试在另一页上的Angle中实现相同的for循环时,这似乎不起作用
I am trying to access the category slug for a product in ionic using the WordPress rest API. This seems to work fine on one page as <h3 class="product-name uppercase">{{productdetail?.categories[0].slug}}</h3>
however this does not seems to work when i try implementing the same using for loop in angular on another page
<div class="width50" *ngFor="let object of dataList">
<img src="{{object.images[0].src}}" width="150" (click)="navigateToPage(object.id)" />
<h3 class="product-name uppercase" text-nowrap>{{object?.categories[0].slug}}</h3>
</div>
出现错误,显示为v.context.$implicit.categories[0] is undefined
,但是在同一页面上,图像源代码似乎可以正常工作.
it gives an error as v.context.$implicit.categories[0] is undefined
however on same page the code for image source seems to work fine.
推荐答案
查看全文