Rather than running config at the initial stage, I would like to config something at a later stage based on some information fetched from server like this:
$http.get(url)
.success( function(response){
angular.module('MyApp').config(['$myServiceProvider', function( $myServiceProvider){
$myServiceProvider.enableSomething(true); // delayed !!!
}]);
});
However the running of the body of config() function is blocked until I loaded some lazy-loaded partial. Maybe a $compile() will trigger it.
I do not understand why it is like this and how to make the config() body invoked immediately.
Thanks.