angular.js - In angular, should DOM operations be placed in the controller or the directive?
过去多啦不再A梦
过去多啦不再A梦 2017-05-15 16:50:45
0
2
841

In Angular, should DOM operations be placed in the controller or the directive?

过去多啦不再A梦
过去多啦不再A梦

reply all(2)
PHPzhong

Put it in the directive.

The controller must not be able to operate the dom. The controller is the data on the operation page.

巴扎黑

Directive is required to operate DOM. For relevant angular writing specifications, please refer to:
https://github.com/johnpapa/angular-styleguide#manipulate-dom-in-a-directive

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template