2

I'm trying to create an app with an auxiliary route for a chat window. The app fails right on the loading. It seems like a bug and I reported it on Angular GitHub, but I wonder if anyone knows a workaround? Here's the plunk of this simple app: http://plnkr.co/edit/JsZbuR

@Component({
  selector: 'basic-routing',
  template: `
    <a [router-link]="['/Home']">Home</a>
    <a [router-link]="['/ProductDetail']">Product Details</a>
    <router-outlet></router-outlet>
    <router-outlet name="chat"></router-outlet>
    <a [router-link]="['/', ['Chat']]">Chat</a>
  `,
  directives: [ ROUTER_DIRECTIVES ]
})
@RouteConfig([
  {path: '/',        component: HomeComponent,          as: 'Home'},
  {path: '/product', component: ProductDetailComponent, as: 'ProductDetail'         },
  {aux:  '/chat',    component: ChatComponent,          as: 'Chat'}
])
class RootComponent { /* ... */ }

It's not clear how the router knows which named route outlet to use.

Dawson
  • 4,391
  • 2
  • 24
  • 33
Yakov Fain
  • 11,972
  • 5
  • 33
  • 38

1 Answers1

4

You have to wait until the issue https://github.com/angular/angular/issues/4694 will be solved.

Current implementation allows only

this.router.navigateByUrl('/(chat)');

See the link http://plnkr.co/edit/lquMdagaVfIoAT83w1pl?p=preview

przemcio
  • 387
  • 3
  • 11
  • Thanks. There are other issues with aux router as well. I've opened another issue: https://github.com/angular/angular/issues/5027 – Yakov Fain Nov 09 '15 at 17:57