We've run into a situation where we need to be able to tell if a view is being shown because the user clicked 'back' (whether via an HTML button, or the back button on their device/browser). Is there any way to do this from within the view's show event?
Now I can tell if a view is being shown due to clicking a back button like this:
functionshow() {
if(!app.isBack) {
// Do stuff that we only want to do on forward navigation,
// like load data from a web server
}
// Do common view show logic
}
This code has some limitations. The biggest being that it only works if you aren't using multiple panes (think phone apps and not tablet apps), but it works for our project. If anyone has any ideas for a more general-purpose solution, I'm all ears.