0
我有我的主网页:角度引导活动菜单项
<li ng-class="{ active: hello.isActive('/page1')}"><a ui-sref="root.content({store:hello.store_selected,product:hello.product_selected})" >page1</a></li>
<li ng-class="{ active: hello.isActive('/page2')}"><a ui-sref="root.turnover({store:hello.store_selected,product:hello.product_selected})">page2</a></li>
我有两个控制器,每个路由:Page1Controller和Page2Controller。我从中挑选代码的主页也有一个控制器:HelloController。 我有我的HelloController
vm.isActive= function(viewLocation){
return viewLocation ===$location.path();
};
当我点击一个项目我获得当前项目点亮。但我有两个问题:当我点击页面上的其他任何地方时,当前项目不再突出显示。并且在页面开始或刷新页面时,我没有突出显示的项目。 你能帮忙吗? 谢谢
'
很好,它工作。谢谢。 – John