Developing a large angularjs
application with the intention of utilizing require.js for lazy-loading additional modules. The main question at hand is whether to create a comprehensive route.js file containing all the routes to other modules, or if each module should define its own routeprovider
and somehow integrate it into the main app.js
file. Is this achievable through require.js
, or will I need to resort to some sort of angularjs
workaround?
The current project structure looks like this:
- frontend
- css
- js
- lib // includes angular.js
- app.js // holds the primary angular.module
- route.js // contains routeProvider for app.js
- modules // directory for modules
- module1
- module1.js
- module2
- module2.js
Alternatively:
- frontend
- css
- js
- lib // includes angular.js
- app.js // holds the primary angular.module
- modules // directory for modules
- module1
- module1.js
- route1.js
- module2
- module2.js
- route2.js