diff --git a/src/state.js b/src/state.js index fffa02e66..452a5ae0a 100644 --- a/src/state.js +++ b/src/state.js @@ -554,7 +554,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ return false; } - return isDefined(params) ? angular.equals($stateParams, params) : true; + return isDefined(params) && params !== null ? angular.equals($stateParams, params) : true; }; $state.includes = function includes(stateOrName, params) { diff --git a/test/stateSpec.js b/test/stateSpec.js index d52a36fca..4c2876b99 100644 --- a/test/stateSpec.js +++ b/test/stateSpec.js @@ -497,6 +497,7 @@ describe('state', function () { it('should return true when the current state is passed', inject(function ($state, $q) { $state.transitionTo(A); $q.flush(); expect($state.is(A)).toBe(true); + expect($state.is(A, null)).toBe(true); expect($state.is('A')).toBe(true); expect($state.is(B)).toBe(false); }));