javascript - AngularJS ng-class not working in ng-repeat with $index -
i have list created ng-repeat works except adding ng-class on condition.
<div ng-repeat="glossary in glossarysections" class="alphabet" ng-click="glossarygotosection($index)" ng-class="{'selected',$index == $parent.glossarysection}"> {{glossary.name}} </div>
ng-click works, , creates dom way expect to, doesn't add 'selected' class alphabet shown.
is there missing in syntax?
there syntax error: replace ,
:
.
modify ng-class="{'selected': $index == $parent.glossarysection}">
.
Comments
Post a Comment