I am struggling with the following code snippet: $scope.counter = '1';
<div ng-repeat="cat in catadata">
<div ng-if="cat.TopCategoryID = 2" >
<div ng-if="counter = 1" >
<div class="feedsDisplay" ng-init="counter = counter + 1">
Creater Img:{{cat.CreatedBy_Profile.Picture.URI}}"
</div>
</div>
</div>
</div>
My goal is to halt the loop when counter = 2
, and only display a single result.
ng-init="counter = counter + 1
{{counter}}
Instead of displaying 11111
as it currently does, I need it to show 12345