1
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 route /dashboard has 2 inheritances: app and common (app.common.Dashboard).
This was necessary because after login the client is redirected to Dashboard, but it is necessary to include in HTML the parts common to all pages, such as sidenav and the toolbar, hence the need for the second inheritance common.
The app.view.html has the following structure:
<div ui-view="sidenav"></div>
<div ui-view="toolbar"></div>
<div ui-view="content"></div>
When accessing Dashboard, the views sidenav and toolbar are filled, but the view content is blank , but Dashboard HTML should appear.
I already checked and the path to the HTML file is correct.
What I did wrong?