I'm working with some AngularJS ng-repeat looping, but I want to generate the markup of a grid, but need to add a 'grid--last' class to the 4th item in the grid, is this achievable?
My HTML:
<div ng-repeat="service in services" class="grid__4">
<div class="services__box">
<img src="img/services/{{service.thumb}}.jpg" alt="" class="services__box__img">
<h1 class="services__box--alpha alpha">{{service.title}}</h1>
<p>
{{service.text}}
</p>
<a href="{{service.url}}.php" class="services__box--btn btn btn--blue">{{service.button}}</a>
</div>
</div>
Ideally I need to get the index of the array and use ng-class. Can anybody shed some light as to how I could do this? Thanks!
ng-class="{}"