In Angular, should DOM operations be placed in the controller or the directive?
PHPz2017-05-15 16:52:45
Put it in the directive.
The controller must not be able to operate the dom. The controller is the data on the operation page.
巴扎黑2017-05-15 16:52:45
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