angularjs - How toc change class in element Angular JS? -


i have html code:

<span id="id_1" ng-click="checkactivity(1)" class="item list-category-item  active ">bga </span> 

how change css class of element inside:

$scope.checkactivity = function(id){} 

modify ng-click ng-click="checkactivity($event)"
, function definition

 $scope.checkactivity = function(evt) {       angular.element(evt.currenttarget).addclass('myclass');     }; 

working demo here


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -