You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In version 0.2.8-bowratic-tedium, if you use ui-sref-active with nested views, the active state is recorded only for the current state. When using nested views, it is logic for the parent state to still be active while in any of its children states.
In my project, I've applied this local quick modification with good results :
In angular-ui-router.js: 2454
// Update route state
function update() {
if ($state.$current.self.name.indexOf(state.name) === 0 && matchesParams()) {
$element.addClass(activeClass);
} else {
$element.removeClass(activeClass);
}
}
Instead of comparing state themselves, I make sure the state name begins with the same pattern, which by convention is the same or a child state.
Could you please apply the same logic (maybe with more error checking) to the next release? It doesn't break existing logic but provide a good logical enhancement.
The text was updated successfully, but these errors were encountered:
In version 0.2.8-bowratic-tedium, if you use ui-sref-active with nested views, the active state is recorded only for the current state. When using nested views, it is logic for the parent state to still be active while in any of its children states.
In my project, I've applied this local quick modification with good results :
In angular-ui-router.js: 2454
Instead of comparing state themselves, I make sure the state name begins with the same pattern, which by convention is the same or a child state.
Could you please apply the same logic (maybe with more error checking) to the next release? It doesn't break existing logic but provide a good logical enhancement.
The text was updated successfully, but these errors were encountered: