I have the following configuration for the routes:
$stateProvider
.state('login', {
public: true,
url: '/login',
templateUrl: 'app/src/components/bo/areas/login/login.view.html',
controller: 'LoginController',
controllerAs: 'vm'
})
.state('app', {
public: false,
abstract: true,
templateUrl: 'app/src/core/views/app.view.html'
})
.state('app.common', {
public: false,
abstract: true,
views: {
'sidenav': {
templateUrl: 'app/src/components/bo/areas/common/sidenav/sidenav.view.html',
controller: 'SidenavController',
controllerAs: 'sidenavvm'
},
'toolbar': {
templateUrl: 'app/src/components/bo/areas/common/toolbar/toolbar.view.html',
controller: 'ToolbarController',
controllerAs: 'toolbarvm'
}
}
})
.state('app.common.dashboard', {
public: false,
url: '/dashboard',
views: {
'content': {
templateUrl: 'app/src/components/bo/areas/dashboard/dashboard.view.html',
controller: 'DashboardController',
controllerAs: 'vm'
}
}
})
;
Notice that the /dashboard
path has 2 inheritance: app
and common
(app.common.dashboard).
This was necessary because after login the client is redirected to the dashboard, but it is necessary to include in the HTML the parts common to all pages, such as sidenav
and toolbar
, hence the need for the second inheritance common
.
app.view.html
has the following structure:
<div ui-view="sidenav"></div>
<div ui-view="toolbar"></div>
<div ui-view="content"></div>
When you access the dashboard, the sidenav
and toolbar
views are populated, but the content
view is blank, but the dashboard HTML should appear.
I've already checked and the path to the HTML file is correct.
What did I do wrong?