I am facing an issue. I am unable active the right menu bar using Angular.js. I have some menu,sub-menu and sub-sub-menu but as per requirement I am unable to active those. I am explaining my code below.
route.js:
var Admin=angular.module('easyride',['ui.router','ui.bootstrap']);
Admin.run(function($rootScope, $state) {
$rootScope.$state = $state;
});
Admin.config(function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/');
$stateProvider
.state('/',{
url: '/',
templateUrl: 'login.html',
controller: 'loginController'
})
.state('dashboard',{
url:'/dashboard',
templateUrl:'dashboard.html',
controller:'dashboardController'
})
.state('dashboard.settings',{
url:'/settings',
templateUrl:'settings.html',
controller:'settingsController'
})
.state('dashboard.settings.area',{
url:'/area',
templateUrl:'area.html',
controller:'areaController'
})
.state('dashboard.settings.area.manageState',{
url:'/manageState',
templateUrl:'manageState.html',
controller:'manageStateController'
})
.state('dashboard.settings.area.manageCity',{
url:'/manageCity',
templateUrl:'manageCity.html',
controller:'manageCityController'
})
})
Here actually when user will get into to the inner page by default the Home table will active. when user will click on settings menu the respective sub-menu Manage Area and sub-sub-menu Manage State tab remain active. I am explaining my page below.
dashboard.html:
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<!--<li ui-sref-active="active" ><a ui-sref="dashboard">Home</a></li>-->
<li ui-sref-active="active"><a ui-sref="dashboard">Home</a></li>
<li ng-class="{'active open': $state.includes('dashboard.settings.area')}"><a ui-sref="dashboard.settings.area.manageState">Settings</a></li>
</ul>
</div>
Here is my full plunkr working code. Here I need when user will click on settings menu the respective sub-menu and sub-sub-menu will remain active and other will inactive which is not happening in my case. Please help.