I have a page where in my ngOnInit I check from where I arrive (for example, if I arrive from page1 I set a variable that I use to show an html, or from page2 another variable to show another html)
ngOnInit() {
this.handleParams();
}
handleParams(){
this.isNewCustomer = JSON.parse(
localStorage.getItem(LocalstorageKeyEnum.NEW_CUSTOMER)
);
let params = this.route.snapshot.queryParams;
if (params.customerCreate === true) {
this.customerCreate = true;
}
this.isUpdate = JSON.parse(
localStorage.getItem(LocalstorageKeyEnum.IS_UPDATE)
);
}
Now I notice that this my ngOnInit() is called only one time, so every time I enter in the page I The handleParams is not checked.
How can I get the ngOnInit called?