i'm setting up config params, but the console.log()
returns me undefined
and i can't understand why, i see the json returned from the http call in console!!!
app.run(function($rootScope, $location,$http){
var update = function (){
$rootScope.config = {};
$rootScope.config.app_name = "Appname";
$rootScope.config.app_short_description = $rootScope.config.app_name+" helps you go out with your rabbit";
$rootScope.config.app_motto = "hey ohhhhhhhhhh <i class='icon-check'></i>";
$rootScope.config.app_url = $location.url();
$rootScope.config.app_path = $location.path();
$http.get('jsons/json.json').success(function(response) {
$rootScope.config.app_genres = response.data;
});
console.log($rootScope.config.app_genres);
}
$rootScope.$on('$routeChangeStart', function(){
update();
});
});