How to specify auxiliary component for child route in angular2 router3

点点圈 提交于 2019-12-03 20:32:36
Arpit Agarwal

You should try forming your URL like below.

this.router.navigateByUrl('/component-c/(c1//aux:auxPath)

As per my last investigation current router version has some issues in navigating to aux outlet using routerLink and navigate method. You should build the full URL and use navigateByUrl.

Plunker with example. Click on detail button and then admin. Admin is routed in admin outlet. Open in full screen to see URL formation.

The URL has following semantics

  1. Child path is separated by /
  2. If a path has siblings then it should be surrounded with parenthesis ()
  3. Sibling are separated by //
  4. Outlet and path is separated by :

    Parent/child/(gchild1//outletname:gchild2)

Another so question

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!