Issue 1:
I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Having an empty base path within a module's routing loaded using loadChildren does not work with named outlet navigation.

Expected behavior

Empty base path does work as documented in the Angular documentation on asynchronous routing. Note that this issue occurs both with asynchronous routing (path-based) loadChildren usage as well as with loadChildren: () => Module.

Minimal reproduction of the problem with instructions

This plunker shows the problem.

Clicking the 'Contact' link doesn't work and produces the error "Cannot match any routes."

app-routing.module

const appRoutes: Routes = [
{ path: 'admin', loadChildren: () => AdminModule },
{ path: '', redirectTo: '/admin', pathMatch: 'full' }
];

admin-routing.module

const adminRoutes: Routes = [
{
path: '',
component: AdminComponent,
children: [
{
path: 'compose',
component: ComposeMessageComponent,
outlet: 'popup'
}
]
}];

This plunker does work.

app-routing.module

const appRoutes: Routes = [
{ path: 'admi', loadChildren: () => AdminModule },
{ path: '', redirectTo: '/admi/n', pathMatch: 'full' }
];

admin-routing.module

const adminRoutes: Routes = [
{
path: 'n',
component: AdminComponent,
children: [
{
path: 'compose',
component: ComposeMessageComponent,
outlet: 'popup'
}
]
}];

The key difference is the adminRoutes path not being empty.

Please tell us about your environment:

Angular version: 2.4.5

Browser: all

Language: all

Issue 2:
I'm submitting a ... (check one with "x")

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Aux-Routes are not found when using two levels of "default routes" (with path:'').

This config works:

RouterModule.forRoot([
{
path: 'tasks', component: TasksComponent, //container-component has two outlets!
children: [
{ path: '', component:TaskListComponent },
{ path: 'overview/:id', component: TasksComponent, outlet: 'right' },
]
}
],

I can open the Tasks-overview by doing:

http://localhost:4200/tasks/(right:overview/3)

See this plnkr and click "to list", "open aux"

As I want to extract the whole Tasks-Functionality into a TasksModule I need to be able to do something like this:

RouterModule.forRoot([
{
path: 'tasks', : children: [ // this one would be in main module
//this is defined in the TasksModule:
{ path: '', component: TasksComponent, //container-component has two outlets!
children: [
{ path: '', component:TaskListComponent },
{ path: 'overview/:id', component: TasksComponent, outlet: 'right' },
]
}
],

I would assume both configs are equivalent, and all of the "normal" routing works perfectly fine. But now the link above http://localhost:4200/tasks/(right:overview/3) leads to:

Uncaught (in promise): Error: Cannot match any routes: 'tasks'

See this plnkr: http://plnkr.co/edit/xd77Mkpqfq6U9tKM4USU?p=preview

Expected/desired behavior

Aux-Routes should also work with empty-path parents

Reproduction of the problem

Working version: http://plnkr.co/edit/Twx4hXQ0TLfHfrYSe4MO?p=preview

Non-working version: http://plnkr.co/edit/xd77Mkpqfq6U9tKM4USU?p=preview

What is the expected behavior?

Both versions of route definition should lead to the same behavior

What is the motivation / use case for changing the behavior?

With the current implementation it is impossible to create an encapsulated Config / Module for the tasks behaviour and include it under a certain path into the main config e.g. "myTasks".

/cc @vsavkin

Please tell us about your environment:

Angular version: 2.0.0-rc.5

Browser: [all ]

Language: [TS ]