My component has both getCurrentNavigation
and router.navigate
I have implemented getCurrentNavigation
from here
Now page having
constructor() {
if (router.getCurrentNavigation().extras.state) {
this.levelId = router.getCurrentNavigation().extras.state.arcadeSelectedGame;
}
}
and navigation to another page
const navigationExtras: NavigationExtras = {
state: {
dummyObject,
gameplay_log_data,
arcadeLevelData: this.arcadeLevelData
}
};
this.router.navigate(['ad-page'], navigationExtras)
Now I have applied solution from here then navigation works but then router.getCurrentNavigation().extras.state
stopped working