If I'm resolving a service in $routeProvider I can inject the service like this and return whatever I want to resolve.
templateUrl: '/static/views/myView.html',
controller: 'myCtrl',
resolve: {
myResolution: function(myService) {
return myService.promise;
}
But I am using a library dependency that gets initialized by a directive in the matching templateUrl. To clarify, a directive in myView.html causes the dependency to get initialized. And I'm injecting this into myCtrl for use there. But in the controller this dependency is null, so its not getting resolved properly.
How do I force angular to resolve this type of dependency before injecting it into my controller?