March 2017
Intermediate to advanced
118 pages
2h 1m
English
We can configure the router service by passing the following options to
RouterModule.forRoot
:
enableTracing option makes the router log all its internal events to the consoleuseHash option enables the location strategy that uses the URL fragment instead of the history APIinitialNavigation option disables the initial navigationerrorHandler option provides a custom error handlerLet's look at each of them in detail.
Setting
enableTracing
to true is a great way to learn how the router works as shown in the following code:
@NgModule({
imports: [RouterModule.forRoot(ROUTES, {enableTracing: true})]
})
class MailModule {}With this option set, the router will log every internal event to the your ...
Read now
Unlock full access