I am currently using ui-router with nested resolve configurations like this :
$stateProvider
.state('route', {
url: '/route',
templateUrl: 'mypage.aspx',
resolve: {
getjson: function (readJson,$http) {
var readjsonget = $http.get('files.json');
readjsonget.then(function (result) {
return result.data;
}, function (ex) {
console.log('GET error', ex);
});
},
load: function ($q, filesInject, getjson) {
files = getjson;
$log.info(2);
return $q.all(files.mape(filesInject.inject));
}
}
})
I have been attempting to pass the content of a JSON file to the second resolve function.
Despite trying multiple approaches, I consistently encounter the issue where the promise success is only triggered after the second function execution.
Any suggestions on how I can address this dilemma?