- 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.
推薦閱讀
- C++案例趣學
- The Supervised Learning Workshop
- AngularJS入門與進階
- Python自然語言處理實戰(zhàn):核心技術與算法
- 程序設計與實踐(VB.NET)
- HTML5 移動Web開發(fā)從入門到精通(微課精編版)
- Mastering OpenCV 4
- Data Analysis with Stata
- Mastering Apache Spark 2.x(Second Edition)
- JavaScript入門經(jīng)典
- 持續(xù)輕量級Java EE開發(fā):編寫可測試的代碼
- JavaScript編程精解(原書第2版)
- MongoDB Cookbook
- Python Penetration Testing Essentials
- R語言:邁向大數(shù)據(jù)之路