Skip to content

Instantly share code, notes, and snippets.

@fritz-gerneth
Created March 15, 2013 00:31
Show Gist options
  • Save fritz-gerneth/5166547 to your computer and use it in GitHub Desktop.
Save fritz-gerneth/5166547 to your computer and use it in GitHub Desktop.
// Very simple controller
var AboutController = function () {
this.dispatch = function (route) {
if (route.url == '/about') {
return Template['about'];
}
};
};
// Init Router
var router = new Meteor.router({
'/about': AboutController
});
var FrontController = function () {
Meteor.autorun(function () {
var currentRoute = router.currentRoute();
var currentController = currentRoute.getController();
var view = currentController.dispatch(currentRoute);
// render view to template variable
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment