Very good question. I could think about it quickly:
angular.module('module1').constant('module1.version', '1.2.3'); angular.module('module2').constant('module2.version', '2.0.0');
I do not know how this fits your needs. But I hope this helps.
The main problem is naming in Angular. You cannot have the same name for services / constants / values, etc. They will be overwritten. I solved this problem with "namespaces" as I showed you above.
An example of entering a namespace, such as names: http://codepaste.net/5kzfx3
Edit:
In your example, you can use it like this:
module2.controller('myCtrl', ['$scope', '$http', '$q', ... , 'module2.version'], function( $scope, $http, $q, ..., version ){ // Here I can use the constant 'version' }
Andrei CACIO
source share