Slice ng-repeat with AngularJS

An easy question from a noob in Angular.

I have my ng-repeat like this:

ng-repeat="f in drillDownList['D' + 
 d.merchMetrics.DEPT_NBR + 'CG' +
 d.merchMetrics.CATG_GRP_NBR + 'C' + 

and I want to slice the last record because it’s alway empty and it comes like that from the WS but I dont know how to achive this in AngularJS.


Inside ng-repeat you have available a variable $last.


<div ng-repeat="item in [1,2,3,4]">
  <div ng-if="!$last">{{item}}</div>

See more

Leave a Reply

Your email address will not be published. Required fields are marked *