Skip to content

Instantly share code, notes, and snippets.

@wmarbut
Last active December 16, 2015 08:29
Show Gist options
  • Save wmarbut/5406461 to your computer and use it in GitHub Desktop.
Save wmarbut/5406461 to your computer and use it in GitHub Desktop.
Allow adding routes at runtime by using `App.MapRoutes` instead of `App.Router.map`
App.map_routes = [];
App.MapRoutes = function(routes) {
App.map_routes.push(routes);
return App.Router.map(function() {
var route_lamda, _i, _len, _ref;
_ref = App.map_routes;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
route_lamda = _ref[_i];
route_lamda.call(this);
}
return true;
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment