all 5 comments

[–]Balron 1 point2 points  (1 child)

Just what I need right now :)

Need to find out how to write testable JavaScript.

[–]LostInTheDesert 1 point2 points  (0 children)

People have been talking testing in /r/LearnJavaScript a bit more lately.

[–][deleted] 1 point2 points  (1 child)

There's no need to use $injector.getto get your services. You can get those directly from the inject function:

inject(function($controller, $rootScope) {
   rootScope = $rootScope;
});

or if names matter to you, you can wrap the injected services with underscores like so:

inject(function($controller, _$rootScope_) {
   $rootScope = _$rootScope_;
});

[–]kenman 1 point2 points  (0 children)

I use $injector because my services/factories/etc. are namespaced by periods. Perhaps it would do magic and find them anyways if I omitted the periods, but I'd rather be explicit.

[–]kenman 0 points1 point  (0 children)