I'm trying to define a function to hold the constant but is not working
(function(){
'use strict';
angular
    .module('app')
    .constant('config1', config1)
    .constant('config2', 
        (function(){
            return {
                VERSION: 2
            }
        }())
    );
function config1() {
    return {
        VERSION: '1'
    }
};
})();
console.log(config1.VERSION); // undefined
console.log(config2.VERSION); // 2

providerwhich can be modified in config phaseconfig1, which you are passing to.CONSTANT()Did you mean to passconfig2, or name theconfig2functionconfig1?config1, looks like you've referenced the func without()compared toconfig2where you use()in which case it will execute...