Angular2 retrieve all elements with class name

后端 未结 5 1726
[愿得一人]
[愿得一人] 2020-12-16 09:55

Can anyone help with how to find \'All\' Elements with a particular class name in Angular 2? I thought it would be trivial but it\'s giving me more problems that was prepar

5条回答
  •  囚心锁ツ
    2020-12-16 10:37

    you need to use DOM in angular

    var element=document.getElementsByClassName("X").item(0);
    

    it works for me!

提交回复
热议问题