News for hackers. Stuff that matters.
Re:Code Organization in Large AngularJS and JavaScript Appli... by liberte9 on Tuesday April 23, 2013 @11:09AM (#5595570)
I'm not sure I agree with the idea of adding utility methods to the $rootScope to avoid wiring in dependencies repeatedly. I would probably go with defining a utility class and indeed injecting it into every controller that needs it. I like the idea of having my utility methods clearly defined in one place. Any opinions here on the pros/cons?
Re:Code Organization in Large AngularJS and JavaScript Appli... by camus on Tuesday April 23, 2013 @11:25AM (#5595688)
I'm for using services to define whatever object used across controllers and other services. Using rootscope or scope inheritance is very tricky in AngularJS
Re:Code Organization in Large AngularJS and JavaScript Appli... by ganarajpr on Tuesday April 23, 2013 @11:39AM (#5595798)
Agreed. Any utility functions should go into a different service.

Using $rootScope feels like a hack.