Skip to content

Instantly share code, notes, and snippets.

@lvbreda
Created July 29, 2012 00:07
Show Gist options
  • Save lvbreda/3195370 to your computer and use it in GitHub Desktop.
Save lvbreda/3195370 to your computer and use it in GitHub Desktop.
Route
var router = Backbone.Router.extend({
routes: {
":page" : "main"
},
main: function (page) {
document.body.innerHTML = "";
var frag = Meteor.ui.render(function () {
if(Template[page]){
return Template[page]();
}
return "";
});
document.body.appendChild(frag);
}
});
Router = new router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment