AngularJS: giving items in ng-repeat a serialized class -


i have simple ng-repeat, , create html serialized class this:

<ul> <li class="item item-1"></li> <li class="item item-2"></li> <li class="item item-3"></li> ... </ul> 

i can't seem find how it. i've tried far, among other things:

<ul> <li ng-repeat="item in items" class="item" ng-class="item-{$index}"></li> </ul> 

it doesn't work.

use syntax:

class="item item-{{$index+1}}" 

working: http://jsfiddle.net/ka3nn/1/


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -