Last active
August 29, 2015 14:26
-
-
Save weeksdev/b970ae726be19da37298 to your computer and use it in GitHub Desktop.
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
| //requires signal-js, crossroads, and hasher to work | |
| crossroads.addRoute('order/{id}', function(id){ | |
| console.log(id); | |
| }); | |
| function parseHash(newHash, oldHash) { | |
| crossroads.parse(newHash); | |
| } | |
| hasher.initialized.add(parseHash); //parse initial hash | |
| hasher.changed.add(parseHash); //parse hash changes | |
| hasher.init(); //start listening for history change |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment