Struggling to make UI-Router's resolve method function properly, I'm encountering an error that I haven't been able to resolve.
Error: No template configuration specified for 'resolve@root'
Here is the definition of my stateProvider:
$stateProvider
.state('root', {
abstract: true,
views: {
'header@': {
template: '<div>Header</div>',
},
'footer@': {
template: '<div>Footer</div>',
}
}
})
.state('root.home', {
views: {
'home@': {
url: '/',
templateUrl: 'src/survey/survey.template.html',
controller: 'homeController'
},
resolve: {
communityId: ['backendFactoryService', function (backendFactoryService) {
backendFactoryService....then(function (res) {
return res;
})
}],
brandingId: ['backendFactoryService', function (backendFactoryService) {
// do stuff
})
}],
community: ['backendFactoryService', function (backendFactoryService) {
// do stuff
})
}],
branding: ['backendFactoryService', function (backendFactoryService) {
// do stuff
})
}]
}
}
})
Within my home.controller.js
(function() {
'use strict'
angular.module('someModule')
.controller('homeController', homeController)
homeController.$inject = [
'$scope',
'branding',
'brandingId',
'community',
'communityId'
];
function homeController(
$scope,
branding,
brandingId,
community,
communityId
) {
$scope.community = community;
$scope.branding = branding;
$scope.brandingId = brandingId;
$scope.communityId = communityId;
}
})();
It's evident that I have specified a templateUrl for the controller and resolve block. I attempted adding an empty
<div ui-view=""></div>
or <ui-view></ui-view>
for my root state, but no luck.
I'm unable to find a solution for the error I'm facing, hoping for assistance here.
UPDATE:
I also tried including a template: ' '
in my root
state. Nevertheless, no change.