What is really exciting about all these features is that they compose very nicely. So we can use them together to handle advanced use cases in just a few lines of code.
Let me give you an example. We have learned that we can use empty-path routes to instantiate components without consuming any URL segments, and we can use componentless routes to consume URL segments without instantiating components. What about combining them?
[ { path: '', canActivate: [CanActivateMessagesAndContacts], resolve: { token: TokenNeededForBothMessagsAndContacts }, children: [ { path: 'messages', component: MesssagesCmp }, { path: 'contacts', component: ContactsCmp } ] } ]
Here we have defined a route that neither consumes any URL segments nor creates any components, but used merely...