angular-ui / ui-router

The de-facto solution to flexible routing with nested views in AngularJS
http://ui-router.github.io/
MIT License
13.56k stars 3.01k forks source link

Feature - Add multi-state support for uiSrefActive #3615

Closed jutaz closed 6 years ago

jutaz commented 6 years ago

This is a quick, interface compliant addition to uiSrefActive to allow for multiple, non-sibling states to activate same class in uiSrefActive. For example:

<div ui-sref-active="{'active': ['owner.**', 'admin.**']}">
  <a ui-sref-active="active" ui-sref="admin.roles">Roles</a>
</div>

Will now be active for when owner.** state is entered, but also admin.**. This makes it much easier to have select parallel states share same class name without resorting to writing boilerplate code to handle that.

Closes #2524