[Angular2 Router] Configure Auxiliary Routes in the Angular 2 Router - What is the Difference Towards a Primary Route?

In this tutorial we are going to learn how we can can configure redirects in the angular 2 router configuration. We are also going to see again another example on how the order of the configuration might trip us. We are going to see the different between path matching in prefix mode vs full mode, and we are going to learn why redirects should be in general configured using full path matching.

 

Define a auxiliary router  in app.routes.ts:

{path: 'wiki-path', loadChildren: 'app/auxroute/auxroute.module', name: 'WikiDetail', outlet: 'wiki'},

 

app.component.html:

<router-outlet class="main"></router-outlet>
<router-outlet name="wiki" class="right-detail"></router-outlet>

The main difference between noraml router outlet and auxiliary router is auxiliary router has name prop.

 

url for auxiliary router:

http://localhost:4200/home(wiki:wiki-path)

it contains: (<outlet_name>:<path_name>)

posted @   Zhentiw  阅读(293)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
历史上的今天:
2015-10-02 [Reactive Programming] RxJS dynamic behavior
2015-10-02 [Reactive Programming] Using an event stream of double clicks -- buffer()
点击右上角即可分享
微信分享提示