I have a menu component:
<nav class="mxmls-mobile-nav">
<button class="mobile-menu-btn visible-xs visible-sm " ng-click="asideVm.open = false">
<i class="ion-android-close"></i>
</button>
</nav>
<a class="navbar-brand visible-xs visible-sm " ui-sref="layout.dashboard">
<img src="assets/images/logo/mxmls-logo.png" alt="" height="30" >
</a>
<nav class="mxmls-main-menu">
<ul class="mxmls-menu">
<li ui-sref-active="active" class="{{item.extraClass}}" ng-repeat="item in asideVm.menuItems" ng-click="asideVm.activateSubmenuParent(item)" ng-class="{'close-menu':item.submenu, 'active': item.activateSubmenu || item.active}">
<a ui-sref="{{item.ui_state}}" ng-if="item.ui_state" ng-click="asideVm.changeType(); asideVm.removeSubmenuActiveState();" ng-bind-html="item.name">
<!-- <i class="fa {{item.icon}} pull-left"></i> -->
<!-- <span class="selected"></span> -->
</a>
<a ui-sref-active="active" ng-if="!item.ui_state;" ng-click="item.submenu = !item.submenu;asideVm.saveStatusMenu()">
<!-- <i class="fa {{item.icon}} pull-left"></i> -->{{item.name}}
<span class="icon-arrow pull-right"></span>
</a>
<ul class="mxmls-submenu" ng-if="item.sections" ng-class="{'hide':item.submenu}">
<li ui-sref-active="active" ng-repeat="subItem in item.sections" ng-class="{'active': subItem.active}">
<a ui-sref="{{subItem.ui_state}}" ng-click="asideVm.changeType(); asideVm.activateSubmenuParent(subItem);">
<!-- <i class="fa {{item.icon}} pull-left"></i> -->{{subItem.name}}
<!-- <span class="selected"></span> -->
</a>
</li>
</ul>
</li>
</ul>
</nav>
The items in asideVm.menuItems have the attribute "active" to focus on it when clicked, using the class "active" (Everything is fine here). However, when clicking on a link like:
<a href="/acm/venta/search" class="btn btn-base ng-binding" ui-sref="layout.acm.state.search({type:'venta'})">Start analysis</a>
the "active" class gets lost in the menu. I need assistance :/
The array "asideVm.menuItems" is stored in the cookie (along with the "active" attribute) and retrieved when the page loads.