March 2017
Intermediate to advanced
118 pages
2h 1m
English
The router provides an observable of navigation events. Any time the user navigates somewhere, or an error is thrown, a new event is emitted. This can be useful for setting up monitoring, troubleshooting issues, implementing error handling and so on.
The very first thing we can do during development to start troubleshooting router-related issues is to enable tracing, which will print out every single event in the console.
@NgModule({
import: [RouterModule.forRoot(routes, {enableTracing: true})]
})
class MailModule {
}
platformBrowserDynamic().bootstrapModule(MailModule);
Read now
Unlock full access