Lets say I have a controller, which depends on two modules that both contain a directive or a service with the same name. Can I specify which one exactly should be used?
angular.module('myApp', ['secondModule', 'thirdModule'])
.controller('Ctrl1', ['$scope', 'myService', function(scope, myService){
scope.user = myService.getUser();
console.log(myService);
}]);
In this case both secondModule and thirdModule have a service called myService. But only the one from the thirdModule will be used in this example. I tried putting something like secondModule.myService as a dependency for Ctrl1, but it wouldn't work. Is there some kind of namespacing in AngularJS?