& quot; v.context.$ implicit.categories [0]是未定义的& quot;Ionic 3中的错误 [英] "v.context.$implicit.categories[0] is undefined" error in Ionic 3
本文介绍了& quot; v.context.$ implicit.categories [0]是未定义的& quot;Ionic 3中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用WordPress rest API访问离子产品的类别标签.在< h3 class ="product-name uppercase"> {{productdetail?.categories [0] .slug}}</h3>
上,这似乎可以在一页上很好地工作,但这确实可以当我尝试在另一页上的Angular中实现相同的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]
,因此出现错误,但是在同一页面上,图像源代码似乎可以正常工作.
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.
推荐答案
查看全文