What is the alternative for jquery each in angularjs?

前端 未结 2 1872
耶瑟儿~
耶瑟儿~ 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 12:59

    you can use the loop statement angular.forEach()

    var values = {name: 'misko', gender: 'male'};
    angular.forEach(values, function(value, key){
      console.log(key + ': ' + value);
    });
    

提交回复
热议问题