Angular2命名为router-outlet链接无法正常工作

时间:2017-02-17 17:11:35

标签: angular angular2-routing

我第一次尝试使用命名的辅助路线时遇到了一些麻烦。我关注these instructions并将this Tour of Heroes demo整合到my app中。主要区别在于我已将演示添加为嵌入较大应用程序中的功能。主页面不会使用适当的组件填充指定的路由器插座,而是重定向到我未找到的页面。

您可以看到已部署的应用here。单击“联系人”按钮以查看会发生什么。

我有this in my template

<a [routerLink]="[{ outlets: { popup: ['compose'] } }]">Contact</a>

,这在my routing module

  {
    path: 'compose',
    component: ComposeMessageComponent,
    outlet: 'popup'
  }

状态栏显示它正在尝试路由到

http://localhost:4200/heroes/crisis-center/(popup:compose)

0 个答案:

没有答案