Last active
December 16, 2015 08:29
-
-
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`
This file contains hidden or 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
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