ui-sref-active="active"
但是当您导航到每个子状态时,还需要为父菜单添加活动类.然后您可以使用ui-router包含.
<li ng-class="{ active: state.includes('parentState') }">
注意:您必须将其添加到控制器:
$scope.state = $state;
关于ng-include,它与$state.include无关.它将外部html编译成指令.