feat(router): add pathMatch property to replace terminal

This commit is contained in:
vsavkin
2016-06-27 20:10:36 -07:00
parent dc64e90ab9
commit fcfddbf79c
9 changed files with 56 additions and 39 deletions

View File

@ -215,7 +215,8 @@ describe('recognize', () => {
it('should match when terminal', () => {
checkRecognize(
[{path: '', terminal: true, component: ComponentA}], '', (s: RouterStateSnapshot) => {
[{path: '', pathMatch: 'full', component: ComponentA}], '',
(s: RouterStateSnapshot) => {
checkActivatedRoute(s.firstChild(s.root), '', {}, ComponentA);
});
});
@ -224,7 +225,7 @@ describe('recognize', () => {
recognize(
RootComponent, [{
path: '',
terminal: true,
pathMatch: 'full',
component: ComponentA,
children: [{path: 'b', component: ComponentB}]
}],
@ -290,7 +291,7 @@ describe('recognize', () => {
component: ComponentA,
children: [
{path: 'b', component: ComponentB},
{path: '', terminal: true, component: ComponentC, outlet: 'aux'}
{path: '', pathMatch: 'full', component: ComponentC, outlet: 'aux'}
]
}],
'a/b', (s: RouterStateSnapshot) => {
@ -359,8 +360,8 @@ describe('recognize', () => {
path: 'a',
component: ComponentA,
children: [
{path: '', terminal: true, component: ComponentB},
{path: '', terminal: true, component: ComponentC, outlet: 'aux'},
{path: '', pathMatch: 'full', component: ComponentB},
{path: '', pathMatch: 'full', component: ComponentC, outlet: 'aux'},
]
}],
'a', (s: RouterStateSnapshot) => {