Is there a way to disable logging of events from platform-browser.es5.js
in Angular 2/4? I want to be able to quickly read through my own logs and the Angular logs are drowning mine out.
Use LoadChildren:For lazy loading. Using this property will optimize your application's performance by only loading the nested route subtree when a user navigates to a particular URL that matches the current route path. It helps in keeping the nested routes table separate.
forRoot( routes, { enableTracing: true } // <-- debugging purposes only ) ] Angular will then log all events to the browser's console, per the documentation: enableTracing?: boolean. When true, log all internal navigation events to the console. Use for debugging.
NavigationEndlinkAn event triggered when a navigation ends successfully. class NavigationEnd extends RouterEvent { constructor(id: number, url: string, urlAfterRedirects: string) type: EventType.
unable to navigate or navigation/router is not working, then we can debug it by enabling the enableTracing option in ExtraOptions of RouterModule. By setting this option, we can log all internal navigation events to the console.
By default, the routing events are not logged. So as Maximus suggested, you must have added code somewhere to turn them on. You just need to remove that code.
In my app, I turned on routing events here, in the app routing module:
RouterModule.forRoot([ { path: 'welcome', component: WelcomeComponent }, { path: '', redirectTo: 'welcome', pathMatch: 'full' }, { path: '**', component: PageNotFoundComponent } ], { enableTracing: true })
If you have code like this, either remove the enableTracing
or set it to false.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With