I am passing data from route with state but component is receiving it only first time, how I can listen it to every time component is visible.
const navigationExtras: NavigationExtras = {
state: { billingInfoData: billinfoData },
};
this.router.navigate(['/tabs/mytab'], navigationExtras);
receiving code is like below in constructor
this.route.queryParams.subscribe(data => {
console.error(data);
this.setSubtitle(data);
if (
this.router.getCurrentNavigation() &&
this.router.getCurrentNavigation().extras.state
) {
console.error(this.router.getCurrentNavigation().extras.state);
}
});