AngularJS best practices
- 7. Why best practices
• for better apps
• less errors
• better performance
• better team-work
• more fun
• to get closer to ng2
- 10. A tree of components
my-app
app-navigationcontact-list
contact-item
toggle-favorite
contact-item
toggle-favorite
contact-item
toggle-favorite
- 15. Business logic and data
live in services
when you are calling $http from a component - you are doing it
wrong
- 19. What is it with scope
inheritance/isolation and performance
- 23. $apply is the root of all
evil
ng-* event-listeners, $http, $q.resolve, $q.reject, $timeout,
- 27. one-way bindings are
a special input-binding
its almost like two way bindings (=), except for when you
change the reference from inside the component.
http://codepen.io/filipbech/pen/pNLPdN
- 29. and don’t use ng-include
subcomponents are almost twice as fast
- 30. Remember to do clean-up
remove event/message listeners and pointers in
$onDestroy
- 32. Watch out for filters in your
template
they are run more often than you think
- 43. so what do you think…
questions, thoughts, comments?