AngularJs using ng-init variable in ng-class

245 views Asked by At

All styles apply in result. What's wrong with this selection?

 <div  ng-init="selectedItem = elements">
   <div class="nav-item" ng-class="{'someStyle' : selectedItem === elements}" 
        ng-click="selectedItem = elements" ></div>
   <div class="nav-item"  ng-class="{'someStyle' : selectedItem === inspector}" 
        ng-click="selectedItem = inspector" > </div>
   <div class="nav-item" ng-class="{'someStyle' : selectedItem === pages}" 
         ng-click="selectedItem = pages" > </div>
</div>
0

There are 0 answers