diff --git a/src/urlMatcherFactory.js b/src/urlMatcherFactory.js index f0a921184..fd4a6ea9b 100644 --- a/src/urlMatcherFactory.js +++ b/src/urlMatcherFactory.js @@ -623,7 +623,6 @@ function $UrlMatcherFactory() { any: { // does not encode/decode encode: angular.identity, decode: angular.identity, - is: angular.identity, equals: angular.equals, pattern: /.*/ } diff --git a/test/stateSpec.js b/test/stateSpec.js index aae3e7524..a2056c66a 100644 --- a/test/stateSpec.js +++ b/test/stateSpec.js @@ -24,6 +24,7 @@ describe('state', function () { DD = { parent: D, params: { x: null, y: null, z: null } }, DDDD = { parent: D, controller: function() {}, template: "hey"}, E = { params: { i: {} } }, + F = { params: { a: '', b: false, c: 0, d: undefined, e: -1 }}, H = { data: {propA: 'propA', propB: 'propB'} }, HH = { parent: H }, HHH = {parent: HH, data: {propA: 'overriddenA', propC: 'propC'} }, @@ -47,6 +48,7 @@ describe('state', function () { .state('DD', DD) .state('DDDD', DDDD) .state('E', E) + .state('F', F) .state('H', H) .state('HH', HH) .state('HHH', HHH) @@ -915,6 +917,7 @@ describe('state', function () { 'DD', 'DDDD', 'E', + 'F', 'H', 'HH', 'HHH', @@ -982,6 +985,12 @@ describe('state', function () { expect($state.params).toEqual({ x: null, y: null }); })); + it("should allow falsy default values for non-url params", inject(function($state, $q) { + $state.go("F"); $q.flush(); + expect($state.current.name).toBe("F"); + expect($state.params).toEqual({ a: '', b: false, c: 0, d: undefined, e: -1 }); + })); + it("should allow arbitrary objects to pass for non-url params", inject(function($state, $q) { $state.go("D", { x: 100, y: { foo: 'bar' } }); $q.flush(); expect($state.current.name).toBe("D");