angular 里$state.includes 写这个不起作用
淡淡烟草味2017-05-15 17:15:20
I found the reason, maybe $scope is not enough scope, you should use $rootScope
nameurl.controller.js
$rootScope.nameURL = $state.includes("nameURL.**");
This sentence means that all nameURL and nameURL subpages will return true
index.html
<li><a ui-sref="nameurl.about" ng-class="{active: nameURL}">关于我们</a></li>