Angular ui router ui-sref-active on parent

后端 未结 4 1569
忘了有多久
忘了有多久 2020-12-19 10:09

I have one parent state and many childs states. If I want the ui-sref-active on the parent to work when I am on one of the child I need to do this \"ha

4条回答
  •  庸人自扰
    2020-12-19 10:48

    You can check parent state only instead of checking all child states

    $scope.isActive = function() {  
       return $state.includes('playLotteries');
    }
    

提交回复
热议问题