Im trying to figure out how to check what page im on when doing a popPage() using onsen uis ons-navigator. I tried the following but they all always return false no matter what:
this.navigator.nativeElement.popPage().then((page: any) => {
console.log("instanceof:", page instanceof BrowsePageComponent);
console.log("typeof:", page instanceof BrowsePageComponent);
console.log("isBrowsePage:", page === BrowsePageComponent);
console.log("isBrowsePage:", page == BrowsePageComponent);
});
A little Context: Navigator is being referenced in my angular app like this:
@ViewChild('navigator') navigator: ElementRef;
After debugging this, i noticed page seems to definitely hold a reference to the page that its navigating to. I just cant figure out how to check if im on a particular page.
I solved this by using the pushedOptions object. It holds a reference to the page class: