Forked from ArthurClemens/gist:1b06a661c14bdb369f7c
Last active
August 29, 2015 14:20
-
-
Save HendrikRoth/ef23d7cdddeb7c484415 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
var Router = function(module, name) { | |
return { | |
controller: function() { | |
// Do something generic like calling Google Analytics from here | |
console.log("Router", name) | |
return new module.controller() | |
}, | |
view: module.view | |
} | |
} | |
m.route(document.getElementById("page"), "/", { | |
"/": Router(app, "app"), | |
"/project/:id": Router(project, "project") | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment