EmmanuelDemey / EmmanuelDemey/eslint-plugin-angular
Manipulate DOM in a Directive (Y072)
- Dominant language
- JavaScript
- Stars
- 620
- Forks
- 127
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/johnpapa/angularjs-styleguide/edit/master/README.md
- When manipulating the DOM directly, use a directive. If alternative ways can be used such as using CSS to set styles or the [animation services](https://docs.angularjs.org/api/ngAnimate), Angular templating, [`ngShow`](https://docs.angularjs.org/api/ng/directive/ngShow) or [`ngHide`](https://docs.angularjs.org/api/ng/directive/ngHide), then use those instead. For example, if the directive simply hides and shows, use ngHide/ngShow.
_Why?_: DOM manipulation can be difficult to test, debug, and there are often better ways (e.g. CSS, animations, templates)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.