Separation of Responsibilities
An extremely important part of designing AngularJS applications is the separation of responsibilities. The whole reason you choose a structured framework is to ensure that code is well implemented, easy to follow, maintainable, and testable. Angular provides a very structured framework to work from, but you still need to ensure that you implement AngularJS in the appropriate manner.
The following are a few rules to follow when implementing AngularJS:
■ The view acts as the official presentation structure for the application. Indicate any presentation logic as directives in the HTML template of the view.
■ If you need to perform any DOM manipulation, do it in a built-in or your own custom directive JavaScript code—and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access