Here is my angular View
<li class= "riskmanagementlink" ng-repeat="link in links">
<h3> {{link.Description}} </h3>
<a> {{link.Title}} </a>
<hr/>
</li>
I would like to remove the hr tag for the last list item. Can anybody help me do this please?
Here is my angular View
<li class= "riskmanagementlink" ng-repeat="link in links">
<h3> {{link.Description}} </h3>
<a> {{link.Title}} </a>
<hr/>
</li>
I would like to remove the hr tag for the last list item. Can anybody help me do this please?
Share Improve this question edited Feb 2, 2017 at 18:02 Preview 35.8k10 gold badges95 silver badges113 bronze badges asked Sep 24, 2014 at 17:35 Aj1Aj1 9732 gold badges16 silver badges42 bronze badges 1-
2
<hr ng-if="!$last"/>
$last
will tell you if it is the last item repeated – PSL Commented Sep 24, 2014 at 17:37
1 Answer
Reset to default 11The ng-repeat
directive es with some extra properties like $last
, which indicates that you're on the last item of your collection.
<li class="riskmanagementlink" ng-repeat="link in links">
<h3> {{ link.Description }} </h3>
<a> {{ link.Title }} </a>
<hr ng-if="!$last" />
</li>
More info in the docs.