javascript - Angular unit test to check if CSS class has been added to DOM element -


i have ng-repeat produces number of dom elements:

    <div "class_{{$index}}" ng-click="checktype(type, $index);"ng-repeat="item in items">{{item}}</div> 

when clicking between first 2 elements want toggle active class between them, i'm doing following, know addclass , removeclass not proper angular way of doing things, working ok me @ moment.

    $scope.checktype = function(m, n){          if(m == 'type one'){             $('.class_0').addclass('be_active');             $('.class_1').removeclass('be_active');         }          if(m == 'type two'){             $('.class_1').addclass('be_active');             $('.class_0').removeclass('be_active');         }     } 

my question is, can write angular unit test check if classes have been added / removed?


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -