diff --git a/src/state.js b/src/state.js index 0ba2d8f97..555f1895c 100644 --- a/src/state.js +++ b/src/state.js @@ -1171,15 +1171,9 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) { options = extend({ relative: $state.$current }, options || {}); var state = findState(stateOrName, options.relative); - if (!isDefined(state)) { - return undefined; - } - - if ($state.$current !== state) { - return false; - } - - return isDefined(params) && params !== null ? angular.equals($stateParams, params) : true; + if (!isDefined(state)) { return undefined; } + if ($state.$current !== state) { return false; } + return params ? equalForKeys(state.params.$$values(params), $stateParams) : true; }; /** @@ -1243,13 +1237,9 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) { } var state = findState(stateOrName, options.relative); - if (!isDefined(state)) { - return undefined; - } - if (!isDefined($state.$current.includes[state.name])) { - return false; - } - return equalForKeys(params, $stateParams); + if (!isDefined(state)) { return undefined; } + if (!isDefined($state.$current.includes[state.name])) { return false; } + return params ? equalForKeys(state.params.$$values(params), $stateParams, objectKeys(params)) : true; }; diff --git a/src/stateDirectives.js b/src/stateDirectives.js index dcfef5592..4d9d527dd 100644 --- a/src/stateDirectives.js +++ b/src/stateDirectives.js @@ -253,15 +253,11 @@ function $StateRefActiveDirective($state, $stateParams, $interpolate) { function isMatch() { if (typeof $attrs.uiSrefActiveEq !== 'undefined') { - return $state.$current.self === state && matchesParams(); + return state && $state.is(state.name, params); } else { - return state && $state.includes(state.name) && matchesParams(); + return state && $state.includes(state.name, params); } } - - function matchesParams() { - return !params || equalForKeys(params, $stateParams); - } }] }; }