JacobF
JacobF

Reputation: 2495

Angular UI Router: The opposite of ui-sref-active

Is it possible to achieve the opposite of ui-sref-active="class1"? I want to insert a class on all states except for the one I define with ui-sref.

I can easily solve this on the CSS side, but I was wondering if I can do this easily with Angular UI Router as well.

Upvotes: 0

Views: 313

Answers (1)

Shawn C.
Shawn C.

Reputation: 6841

You can take the current uiSrefActive from Github and inverse the isMatch function in a new directive of your naming and add it to your link as an attribute.

Upvotes: 1

Related Questions