I'm finding that router.isActive
is returning false
any time a secondary route is open.
Is router.isActive
suitable for checking 'am I on route (x)?' (e.g.: payments page) - regardless of hashstates, query params and secondary routes.
Should router.isActive
be the right service/call to deduce this? Or is it intended for something simpler. Is there an alternative? Should write my own service?
E.g.:
- When on
/second
,router.isActive('second', true)
=== true- (good)
- When on
second(modal:my-modal)
,router.isActive('second', true)
=== false- The issue: This function is now no longer useful to determine if I'm on the second page
- When on
/second
,router.isActive('', false)
=== true. (non-exact matches return true parent/child states
I've created a plnkr proof of concept, for easier testing: