March 2017
Intermediate to advanced
118 pages
2h 1m
English
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, ...
Read now
Unlock full access