I am looking to detect a route change in my AppComponent.
AppComponent
Thereafter I will check the global user token to see if he is logged in. Then I can redirect t
In angular 6 and RxJS6:
import { filter, debounceTime } from 'rxjs/operators'; this.router.events.pipe( filter((event) => event instanceof NavigationEnd), debounceTime(40000) ).subscribe( x => { console.log('val',x); this.router.navigate(['/']); /*Redirect to Home*/ } )