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

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -