Skip to content

Commit 094dc30

Browse files
committed
fix($state): allow null to be passed as 'params' param
1 parent 8592142 commit 094dc30

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/state.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
554554
return false;
555555
}
556556

557-
return isDefined(params) ? angular.equals($stateParams, params) : true;
557+
return isDefined(params) && params !== null ? angular.equals($stateParams, params) : true;
558558
};
559559

560560
$state.includes = function includes(stateOrName, params) {

test/stateSpec.js

+1
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ describe('state', function () {
497497
it('should return true when the current state is passed', inject(function ($state, $q) {
498498
$state.transitionTo(A); $q.flush();
499499
expect($state.is(A)).toBe(true);
500+
expect($state.is(A, null)).toBe(true);
500501
expect($state.is('A')).toBe(true);
501502
expect($state.is(B)).toBe(false);
502503
}));

0 commit comments

Comments
 (0)