If I have this module:
angular.module('myMod', [])
.factory('MyService', ['$http', 'Common', function ($http, Common) {
var neededUrl = Common.myUrl;
}]);
And I loaded up my app modules this way:
angular.module('myApp', [
'myMod'
])
.factory('Common', function () {
return {
myUrl: "/Some/Url"
}
});
Will myMod be able to pick up on the Common dependency and load it up?
Or is it better to do this:
angular.module('common.module', [])
.factory('Common', function () {
return {
myUrl: "/Some/Url"
}
});
angular.module('myApp', [
'common.module',
'myMod'
])