84669 人學習
152542 人學習
20005 人學習
5487 人學習
7821 人學習
359900 人學習
3350 人學習
180660 人學習
48569 人學習
18603 人學習
40936 人學習
1549 人學習
1183 人學習
32909 人學習
angular中dom操作放controller還是directive裡?
放directive裡。
controller必須不能操作dom。 controller是操作頁面上的資料。
操作DOM需要使用directive,相關的angular編寫規格可以參考:https://github.com/johnpapa/angular-styleguide#manipulate-dom-in-a-directive
放directive裡。
controller必須不能操作dom。 controller是操作頁面上的資料。
操作DOM需要使用directive,相關的angular編寫規格可以參考:
https://github.com/johnpapa/angular-styleguide#manipulate-dom-in-a-directive