I am trying to work out how I can check if the route was loaded programmatically or if the back button was clicked / pressed instead. I have done some searching but I can’t seem to find anything that is relevant, and the route params don’t seem to contain anything to help my check either.
My reason for this is when my page is loaded we do an API call to retrieve a list of items, but after you click through to the item page then click Back, it does the API call again (using
I could just have the API call in the
constructor method so it’s only done once, but in most cases when someone is routed to the page (for example using
this.router.navigate(['list']) I actually do want it to trigger so
ionViewWillEnter makes more sense.
Any help would be appreciated! Or perhaps a better way of looking at this?