Created
March 15, 2013 00:31
-
-
Save fritz-gerneth/5166547 to your computer and use it in GitHub Desktop.
This file contains 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
// 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