I don't think it's nice to use the config.js file when developing AngularJS applications. The reason is that you are breaking any automatic testing feature.
Instead, I create a Settings service in which I specify a specific application context. For instance:
angular.module('settings',[]).factory('SettingsService',function(){ var service={};
Then insert the SettingsService into the controllers that need access to the settings.
Of course (which I have omitted for simplicity here), you could instead create a ServiceService with an empty body, and then in the .run () application a method to get parameters from the server.
I use a simple method and support a ServiceService for each type of deployment ("development", "test", "production", etc.). Then just include the correct SettingsService parameter in your build script depending on the target (I use Grunt, but you can also use Ant).
source share