diff --git a/modules/angular2/src/router/route_registry.ts b/modules/angular2/src/router/route_registry.ts index a08e11c94d..43aecb1391 100644 --- a/modules/angular2/src/router/route_registry.ts +++ b/modules/angular2/src/router/route_registry.ts @@ -211,7 +211,7 @@ export class RouteRegistry { } else if (segment == '' || segment == '.' || segment == '..') { throw new BaseException(`"${segment}/" is only allowed at the beginning of a link DSL.`); } - let params = null; + let params = {}; if (i + 1 < linkParams.length) { let nextSegment = linkParams[i + 1]; if (isStringMap(nextSegment)) { diff --git a/modules/angular2/test/router/route_registry_spec.ts b/modules/angular2/test/router/route_registry_spec.ts index 9e0136e693..04ee4a3b26 100644 --- a/modules/angular2/test/router/route_registry_spec.ts +++ b/modules/angular2/test/router/route_registry_spec.ts @@ -79,6 +79,13 @@ export function main() { expect(url).toEqual('first/one/second/two'); }); + it('should geneate params as an empty StringMap when no params are given', () => { + registry.config(RootHostCmp, + new Route({path: '/test/...', component: DummyParentParamCmp, as: 'test'})); + var instruction = registry.generate(['test'], RootHostCmp); + expect(instruction.component.params).toEqual({}); + }); + it('should generate URLs of loaded components after they are loaded', inject([AsyncTestCompleter], (async) => { registry.config(