Created
January 2, 2015 21:21
-
-
Save ctrlShiftBryan/7849d03137a8bdb20ccd to your computer and use it in GitHub Desktop.
Cancel a route and reload in sammy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sam.before({}, function () { | |
| var cancel = false; | |
| if (vm.LastLocation) { | |
| cancel = vm.LastLocation !== window.location.pathname; | |
| } | |
| vm.LastLocation = window.location.pathname; | |
| if (cancel) { | |
| window.location.reload(); | |
| } | |
| return !cancel; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment