Answer the question
In order to leave comments, you need to log in
How to make nested states in AngularJS ui-router?
Please help me figure out why the core.api.create state is not rendered.
JS:
$stateProvider
//core
.state('core', {
url: '/core',
templateUrl: './core.html',
controller: 'MainCtrl'
})
.state('core.api', {
url: '/api',
views: {
'': {
templateUrl: './js/app/core/api/api.html',
controller: 'ApiListController'
}
}
})
.state('core.api.create', {
url: '/create',
view: {
'': {
templateUrl: './js/app/core/api/api_create.html',
controller: 'ApiCreateController'
}
}
});
<div class="page-content">
<div class="content">
<ui-view></ui-view>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
Most likely you have an error in the template for core.api . The documentation for uiRouter says that:
//Relatively targets the unnamed view in this state's parent state <div ui-view/>
"" : { ... }
// absolutely targets the unnamed view in root unnamed state.
// <div ui-view/>
"@" : { ... }
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question