@onfiredigital wrote:
Hi all,
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
ionViewWillEnter
hook).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 usingthis.router.navigate(['list'])
I actually do want it to trigger soionViewWillEnter
makes more sense.Any help would be appreciated! Or perhaps a better way of looking at this?
Posts: 5
Participants: 3