diff --git a/src/urlMatcherFactory.js b/src/urlMatcherFactory.js index ea5071adc..3b733f9ae 100644 --- a/src/urlMatcherFactory.js +++ b/src/urlMatcherFactory.js @@ -917,8 +917,7 @@ function $UrlMatcherFactory() { } function getType(config, urlType, location) { - if (config.type && urlType.name !== 'string') throw new Error("Param '"+id+"' has two type configurations."); - if (config.type && urlType.name === 'string' && $types[config.type]) return $types[config.type]; + if (config.type && urlType) throw new Error("Param '"+id+"' has two type configurations."); if (urlType) return urlType; if (!config.type) return (location === "config" ? $types.any : $types.string); return config.type instanceof Type ? config.type : new Type(config.type); diff --git a/test/urlMatcherFactorySpec.js b/test/urlMatcherFactorySpec.js index aa42f12f3..3d6cf15d4 100755 --- a/test/urlMatcherFactorySpec.js +++ b/test/urlMatcherFactorySpec.js @@ -520,21 +520,6 @@ describe("urlMatcherFactory", function () { expect(m.format({ foo: 5, flag: true })).toBe("/5/1"); }); - it("should match types named only in params", function () { - var m = new UrlMatcher("/{foo}/{flag}", { - params: { - foo: { - type: 'int' - }, - flag: { - type: 'bool' - } - } - }); - expect(m.exec("/1138/1")).toEqual({ foo: 1138, flag: true }); - expect(m.format({ foo: 5, flag: true })).toBe("/5/1"); - }); - it("should encode/decode dates", function () { var m = new UrlMatcher("/calendar/{date:date}"), result = m.exec("/calendar/2014-03-26");