Javascript 如何进行双套角重复
我有一个模板,它是按照以下方式构造的Javascript 如何进行双套角重复,javascript,json,angularjs,angularjs-ng-repeat,Javascript,Json,Angularjs,Angularjs Ng Repeat,我有一个模板,它是按照以下方式构造的 <div ng-repeat="itemEntry in itemEntry"> <!-- content --> <section class="product-view-wrapper" ng-repeat="productView in itemEntry.Productview"> <div class="slide" ng-repeat="productImg in itemEnt
<div ng-repeat="itemEntry in itemEntry">
<!-- content -->
<section class="product-view-wrapper" ng-repeat="productView in itemEntry.Productview">
<div class="slide" ng-repeat="productImg in itemEntry.productImgs">
<img ng-src="{{productImgs.img}}"/>
</div>
<!-- Content -->
</section>
</div>
但是,我注意到,当通过inspect元素查看时,productImg
内容不会出现。再次说明,当对ng重复函数进行双重嵌套时,结构是否正确?如果可以这样做的话
您没有在嵌套重复中的正确数组上重复。我将您的演示缩小到与问题相关的html
<section class="product-view-wrapper" ng-repeat="productObject in itemEntry">
<!-- each loop of the <section> will output from productObject contained in itemEntry array -->
<h3>{{productObject.productDesc}}</h3>
<img ng-src="{{productObject.image}}" height="120px">
<h4>Repeating images</h4>
<!-- want to loop over array contained in each productObject -->
<div class="slide" ng-repeat="productImg in productObject.productImgs" style="float:left">
<img ng-src="{{productImg.img}}" height="80px" />
</div>
<hr style="clear:both">
</section>
{{productObject.productDesc}
重复图像
这是可以做到的,看看关于这个问题的其他问题
<section class="product-view-wrapper" ng-repeat="productObject in itemEntry">
<!-- each loop of the <section> will output from productObject contained in itemEntry array -->
<h3>{{productObject.productDesc}}</h3>
<img ng-src="{{productObject.image}}" height="120px">
<h4>Repeating images</h4>
<!-- want to loop over array contained in each productObject -->
<div class="slide" ng-repeat="productImg in productObject.productImgs" style="float:left">
<img ng-src="{{productImg.img}}" height="80px" />
</div>
<hr style="clear:both">
</section>