- Angular Router
- Victor Savkin
- 142字
- 2021-07-09 19:20:30
Router configuration
The router configuration defines all the potential router states of the application. Let's look at an example:
[ { path: ':folder', children: [ { path: '', component: ConversationsCmp }, { path: ':id', component: ConversationCmp, children: [ { path: 'messages', component: MessagesCmp }, { path: 'messages/:id', component: MessageCmp } ] } ] }, { path: 'compose', component: ComposeCmp, outlet: 'popup' }, { path: 'message/:id', component: PopupMessageCmp, outlet: 'popup' } ]
Don't worry about understanding all the details. I will cover them in later chapters. For now, let's depict the configuration as follows:

As you can see the router configuration is a tree, with every node representing a route. Some nodes have components associated with them, some do not. We also use color to designate different outlets, where an outlet is a location in the component tree where a component is placed.
推薦閱讀
- Go Web編程
- ClickHouse性能之巔:從架構設計解讀性能之謎
- 編程珠璣(續)
- ASP.NET動態網頁設計教程(第三版)
- Nginx Essentials
- MySQL數據庫基礎實例教程(微課版)
- Windows Server 2016 Automation with PowerShell Cookbook(Second Edition)
- Mastering Drupal 8 Views
- ElasticSearch Cookbook(Second Edition)
- Struts 2.x權威指南
- 從零學Java設計模式
- Python編程快速上手2
- Java EE程序設計與開發實踐教程
- AI輔助編程Python實戰:基于GitHub Copilot和ChatGPT
- 新手學ASP.NET 3.5網絡開發