Created
November 14, 2012 03:59
-
-
Save sagar-ganatra/4070174 to your computer and use it in GitHub Desktop.
Backbone Router example
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", | |
"welcome": "welcome" | |
}, | |
index: function() { | |
loginViewInstance.render(); | |
}, | |
welcome: function() { | |
welcomeViewInstance.render(); | |
} | |
}); | |
var appRouterInstance = new AppRouter(); | |
Backbone.history.start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now we have to use Backbone.history.start({pushState:true});
Backbone.JS Training in Chennai