I want to loop a json array using angularjs,
<p class="gwc-p mar-t20" ng-repeat="shopdata in cartinfo.shopList" > </p>
But is there any way to loop the flashback?
Try this:
<p class="gwc-p mar-t20" ng-repeat="shopdata in cartinfo.shopList.slice().reverse()" ></p>
Or declare a filter...
js:
app.filter('reverse', function() { return function(items) { return items.slice().reverse(); }; });
view:
<p class="gwc-p mar-t20" ng-repeat="shopdata in cartinfo.shopList | reverse" ></p>
js itself has the reverse function reverse()
<p class="gwc-p mar-t20" ng-repeat="shopdata in cartinfo.shopList | orderBy:shopId:reverse"></p>
Try this:
Or declare a filter...
js:
view:
js itself has the reverse function reverse()
<p class="gwc-p mar-t20" ng-repeat="shopdata in cartinfo.shopList | orderBy:shopId:reverse"></p>