I am using canDeactivate()
in a view-model. There is a way for the user to navigate away from the view where canDeactivate
should not do its checks and just return true (in this case, when the user presses a Back button which is in another view). It appears that canDeactivate
does not take any arguments (such as the params passed to router.navigateToRoute
). If it did, I could indicate that the Back button was pressed in the params arg when calling navigateToRoute
. What would be a good way to give canDeactivate
this needed piece of information?
starting in aurelia-router 1.4.0, canDeactivate is passed an argument which contains the information you need to accomplish this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With