Let's say I have three factories of the same name DSerrorLog
each under different module
angular.module('module1').factory('DSerrorLog', function () {
return { show: false, msg: "" };
});
angular.module('module2').factory('DSerrorLog', function () {
return { show: false, msg: "" };
});
angular.module('module3').factory('DSerrorLog', function () {
return { show: false, msg: "" };
});
How do I inject the correct instances from the correct module one e.g. DSerrorLog
under module3
into my controller? I suppose syntax such as module3.DSerrorLog
won't work here.
angular.module('mainApp', ['module1', 'module2', 'module3'])
app.controller('MainCtrl', function ($scope, DSerrorLog) {
});