I am trying to read json file and get data before controller call .But I am not able to display the output why ?
I make one factory like this
.factory('abc',function($http){
return{
loadData:function(successCallback,errorCallbak){
return $http.get('data.json').success(successCallback).error(errorCallbak)
}
}
})
I used resolve function like that
resolve: {
user: function (abc) {
return abc.loadData
}
}
But it not displaying the output in HTML why ?
template: '<b>Welcome {{home.user.name}}!</b>',
Expected output is Welcome Naveen
abc.loadDatai don't see you are passingsuccessCallback&errorCallbackthere and additionally resolve function returns promise object. but here you have used callback, that might be another reason behind it..