March 2017
Intermediate to advanced
118 pages
2h 1m
English
We have seen that path expressions can contain two types of segments:
path: 'messages'
)
path: ':folder'
)Using just these two we can handle most use cases. Sometimes, however, what we want is the "otherwise" route. The route that will match against any provided URL. That's what wildcard routes are. In the following example we have a wildcard route
{ path: '**', redirectTo: '/notfound' }
that will match any URL that we were not able to match otherwise and will activate
NotFoundCmp
.
[ { path: ':folder', children: [ { path: '', component: ConversationsCmp }, { path: ':id', component: ConversationCmp, children: [ { path: 'messages', component: MessagesCmp }, { path: 'messages/:id', ...Read now
Unlock full access