Let's say you have a
var app = angular.module('Mod1',[])
and now you need to inject something else to that module, but you can't change that line, you only have access to the app
variable.
So this won't work, right?
var mod2 = angular.module('mod2',[]).factory('$myService', function(){
return { do: function(){alert('doing'); }
})
app.directive('foo',[$myService]) // $myService here is undefined
Of course you can always do:
injector = angular.injector(['mod2'])
$myService = injector.get('$myService')
Although I'm wondering if there's more elegant solution