Empty-path routes
If you look at our configuration once again, you will see that some routes have the path set to an empty string. What does it mean?
[ { path: ':folder', children: [ { path: '', component: ConversationsCmp } ] } ]
By setting path
to an empty string, we create a route that instantiates a component but does not "consume" any URL segments. This means that if we navigate to
/inbox
, the router will do the following:
First, it will check that
/inbox
starts with
:folder
, which it does. So it will take what is left of the URL, which is ''
, and the children of the route. Next, it will check that ''
starts with ''
, which it does! So the result of all this is the following router state:
Empty path routes can have children, and, in general, behave like normal routes. The only special thing about them is that they inherit matrix parameters of their parents. This means that this...