Reputation: 196
Hi am stuck somewhere in my code below image shows my response data I receive from Api.
this is my code I want to make a nested ng-repeat for my Genre but am getting error of
<div class="col-3" id="umovies" ng-repeat="movies in sectionInTheaterMovieProduct" lightgallery>
<figure class="box movie-bx">
<div class="prod-img">
<a href="{{movies.HypCat_Name}}">
<img ng-src="{{movies.Image}}" alt="{{movies.cat_name}}"/>
</a>
</div>
<figcaption>
<div class=""><a href="{{movies.HypCat_Name}}">{{movies.cat_name}}</a></div>
<p class="notify">{{movies.Parent2Name}}</p>
<p class="notify movie-ty"><span ng-repeat="(key,value) in movies.Genre">{{Key}} : {{value}}</span></p>
<div class="review-rating">
<div class="avg-star">{{movies.Rating}} <span class="icon-rating unrated-star"></span></div>
<div class="recommendation">
<span class="icon-like"></span><span>{{movies.Recommendation}}%</span>
</div>
<div class="reviews-cnt">
<a class="small" href="{{movies.HypCat_Name}}">{{movies.ReviewCount}} {{movies.ReviewCount == 1 ? 'Review' : 'Reviews'}}</a>
</div>
</div>
</figcaption>
</figure>
</div>
can anyone help me please I need output shown in below image
Upvotes: 0
Views: 141
Reputation: 222582
Use track by index to avoid duplicates error, since movies.Genre is a comma separated string
<span ng-repeat="(key,value) in movies.Genre.split(',') track by $index"
since movies.Genre is a comma separated string, you can use .split(',') to make it array.
Upvotes: 1