Angular2路由器:routerLink切换2个出口应该是什么?

时间:2017-02-16 15:08:39

标签: angular angular2-routing

我有2个网点:

<router-outlet></router-outlet>
<router-outlet name="popup"></router-outlet>

和路线:

const routes = [
  { path: '', component: HomeComponent },
  { path: 'user', component: UsersComponent },
  { path: 'user', component: UsersComponent, outlet: 'popup'}
];

为主要和弹出网点输出UsersComponent应该是什么routerLink?

1 个答案:

答案 0 :(得分:1)

你应该写

<a [routerLink]="[{outlets: {primary: 'user', popup: 'user'}}]">Open Chat1</a>