Is there a way to access the previous route/instruction from the Durandal.js router? I know I can do router.navigateBack() to actually navigate back, but I want to know the route that I will navigating back to before I trigger the navigation.
How to access the previous route from Durandal router
968 views Asked by jbgarr At
1
Not directly I'm afraid.
router.navigateBack() is defined in router.js as
And history.navigateBack() is defined in history.js as
and history.history is an alias defined above for window.history which is part of the browser and would cause security issues if exposed.
If you want to have that functionality you'll have to implement it yourself. Possibly by intercepting
router.navigate()androuter.navigateBack().