Created
August 8, 2012 04:59
-
-
Save psykidellic/3292208 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
| var AppRouter = Backbone.Router.extend({ | |
| routes:{ | |
| "":"index", | |
| "test": function() { | |
| console.log("Test method"); | |
| }, | |
| "foo": function() { | |
| console.log("Foo method"); | |
| }, | |
| "bar": function() { | |
| console.log("Bar method"); | |
| } | |
| }, | |
| index:function () { | |
| console.log('To index'); | |
| } | |
| }); | |
| ... | |
| var router = new AppRouter(); | |
| Backbone.history.start({pushState: true}); | |
| ... | |
| #test-links | |
| %a{ :href => '#test'} Test | |
| %a{ :href => '#foo'} Foo | |
| %a{ :href => '#bar'} Bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment