Created
February 7, 2013 15:26
-
-
Save raymatos/4731621 to your computer and use it in GitHub Desktop.
Subroutes in backbone?
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
app_router.on('route:showProjects', function(){ | |
require(['views/projects/ProjectsView',], | |
function(ProjectsView){ | |
//sub routes | |
var ProjectRoutes = Backbone.Router.extend({ | |
routes : { | |
'clients/:id': 'showClients' | |
} | |
}) | |
var projectRoutes = new ProjectRoutes(); | |
projectRoutes.on('route:clients', function(id){ | |
//require and run view | |
}) | |
var projectsView = new ProjectsView(); | |
projectsView.render(); | |
} | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment