In the latest version of Angular 7.2.6, I\'m trying to pass data in router itself
this.router.navigate([\'other\'], {state: {someData: \'qwert\'}}
change the code like this because after constructor() only the ngOnInit() gets called so the value is getting null
constructor()
ngOnInit()
constructor(private router: Router) { this.name = this.router.getCurrentNavigation().extras.state.example; }