What is the alternative for jquery each in angularjs?

前端 未结 2 1881
耶瑟儿~
耶瑟儿~ 2020-12-25 12:17

I want to remove jquery from my app.. But I want substitute for $.each in angularjs... How can I loop around dom elements ?? Here I have added my code.. I want to convert i

2条回答
  •  渐次进展
    2020-12-25 13:07

    angular.forEach(angular.element("li a"), function(value, key){
         var a = angular.element(value);
         a.addClass('ss');
    });
    

    You can convert it into object and then, you can use it..

提交回复
热议问题