Closed ghost closed 12 years ago
Hi, a huge 'controller' file may be difficult to handle as you've noticed. You can split its content across multiple files as you're probably doing with your views and models.
For instance, you can define a certain namespace:
App.Router
and add the functions you need, using either $.extend or simple assignments (App.Router.aCertainHandler=function(){... ).
The files containing your routes may be loaded in your index.html file with Githubissues.
My app is based on jQM, this router, backbone.js, require.js and runs on node.
The app routes and handlers reside all in one file. While the app is growing this file becomes quite huge. Is my approach the preferred design or is the a better way?