Skip to content

Commit

Permalink
fix($state): allow null to be passed as 'params' param
Browse files Browse the repository at this point in the history
  • Loading branch information
dlukez committed Dec 16, 2013
1 parent 8592142 commit 094dc30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/state.js
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions test/stateSpec.js
Expand Up @@ -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);
}));
Expand Down

0 comments on commit 094dc30

Please sign in to comment.