diff --git a/src/urlMatcherFactory.js b/src/urlMatcherFactory.js index 83044bf28..fa4edf16d 100644 --- a/src/urlMatcherFactory.js +++ b/src/urlMatcherFactory.js @@ -230,7 +230,7 @@ UrlMatcher.prototype.exec = function (path, searchParams) { for (/**/; i < nTotal; i++) { param = params[i]; cfg = this.params[param]; - values[param] = isDefined(searchParams[param]) ? cfg.type.decode(searchParams[param]) : cfg.value; + values[param] = cfg.$value(searchParams[param]); } return values; diff --git a/test/urlMatcherFactorySpec.js b/test/urlMatcherFactorySpec.js index 80b500c23..1926c491e 100644 --- a/test/urlMatcherFactorySpec.js +++ b/test/urlMatcherFactorySpec.js @@ -356,6 +356,15 @@ describe("urlMatcherFactory", function () { } }); expect(m.exec('/foo').bar).toBe("Value from bar()"); + + var m = new UrlMatcher('/foo?bar', { + params: { + bar: function() { + return "Value from bar()"; + } + } + }); + expect(m.exec('/foo').bar).toBe("Value from bar()"); }); it("should allow injectable functions", inject(function($stateParams) {