Skip to content

Angular2 router path / matches incorrectly if it is the first in a list. #2221

@irfantusneem

Description

@irfantusneem

Clicking on DEF link below causes a match on "/". Two bugs here, one is that "/" is being matched. Second the alias is not correctly picking up the correct config immediately.

Also documentation says to use 'alias' where as the code uses 'as'.

DEF

router-link
_router.config([
{ 'path': '/', 'redirectTo': '/abc' }, // matches prematurely.
{ 'path': '/abc', 'component': AbcComponent,
'as' : 'abc' },
{ 'path': '/def', 'component': DefComponent,
'as' : 'def'},
]);

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions