During experimentation with AngularJS and using my previous experience with MV* set of patterns and their implementation I found out some interesting facts that may help you a lot in the future development of a loosely coupled web front-end.
As a recommended practice, the Directives should know and modify the View; the View must know about its controller and how to interact with it; the Controller should know and use Services. That’s it. Keep it clean and you’ll be on the safe side. No unicorns, ok?
[sdropcap]4.[/sdropcap] The controller should be build around the Single Responsibility principle. Should do one thing and one thing only. If you need extra interaction, just split it in two controllers – will improve your testing and your certainty that every execution path is proven to be correct using testing.
[sdropcap]5.[/sdropcap] And please, set a naming convention and use it consistently! Whatever you like and suits your style, but be expressive when naming because you’ll spare a lot of debugging time later!
[ideabox]This article is based on my previous experience with MV* implementations- MVVM and MVC mainly:
- Mobile: Silverlight for Windows Phone
- Web: Ruby on Rails and ASP .Net MVC; Knockout, ExtJS, Kendo UI and AngularJS
- WPF: Surface multi-touch multi user framework