Within a page, numerous Angular modules are present. I have set up a constant for each module containing the version number.
var module1 = angular.module('module1').constant('version', '1.2.3');
var module2 = angular.module('module2').constant('version', '2.0.0');
...
I was under the impression that a constant is declared inside a module. However, when I try to use the constant within module1, it returns the value '2.0.0'...
Is there a way to define a constant (or any other entity) specific to a module?
Edit: If there are alternative solutions, could you explain how to apply them, such as in declaring a controller?
module2.controller('myCtrl', function($scope, $http, $q, ..., version){
// The constant 'version' can be utilized here
}