Skip to content

Instantly share code, notes, and snippets.

@jboulhous
Created January 28, 2013 11:52
Show Gist options
  • Save jboulhous/4654921 to your computer and use it in GitHub Desktop.
Save jboulhous/4654921 to your computer and use it in GitHub Desktop.
Backbone.Router for Meteor
// Router for Pages
Session.set("currentPage", null);
var SimpleRouter = Backbone.Router.extend({
routes: {
"": "index",
"signup": "signup"
},
index: function () {
console.log("router : index")
Session.set("currentPage", "index");
},
signup: function () {
console.log("router : signup")
Session.set("currentPage", "signup");
}
});
var Router = new SimpleRouter;
Meteor.startup(function () {
Backbone.history.start({pushState: true});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment