1
In index.html I have ng-view where HTML content is loaded:
<body>
<div ng-include src="'view/sidebar.html'" class="sidebar sidebar-left" toggleable parent-active-class="sidebar-left-in" id="mainSidebar"></div>
<div ng-include src="'view/sidebarRight.html'" class="sidebar sidebar-right" toggleable parent-active-class="sidebar-right-in" id="rightSidebar"></div>
<div class="app">
<ng-view class="app-content"></ng-view>
</div>
</body>
In the same index.html I do include 2 files (sidebar.html and sidebarRight.html) according to the above code, but these files should only appear after login.
In the application, after login the user is redirected to Dashboard.html, see route Provider:
$routeProvider.
//...
.when('/dashboard', {
title: 'Dashboard',
templateUrl: 'view/dashboard.html',
controller: 'authCtrl'
})
//...
I’ve seen that it’s not allowed to have more than one "ng-view", so how do I solve the problem?
I tried to put the includes inside Dashboard.html, but I would have to duplicate it for several pages and in the template I’m using, it’s really necessary to be outside the div "app".