Wednesday, 4 September 2019

Angular / ionic Check for same page navigation event

I have a bottom menu that contains a few buttons that each link to a page using navigate:

this.navigate(TimelinePath, 'back');

Then I have an overlay that checks for the path to test if it should close:

this.routerSubscription = this.router.events.subscribe((val) => {
    if (val instanceof NavigationEnd) {
        this.closeModal();
    }
});

This works, however there is an issue with it: If I am already standing on the page I try to redirect to, this event is not fired.

So my question is: How can I check whether the page that should be redirected to is already opened?



from Angular / ionic Check for same page navigation event

No comments:

Post a Comment