Angularjs : Code organisation of controllers

angularjs, javascript, project-organization

Solution

I make extensive use of the `angular.module().controller()` syntax to group my controllers by module, which has greatly improved the organization of my angular code. As an added benefit, your controllers are no longer globally name-spaced functions.

You can read more in the Module API documentation.

Problem

I used the angular seed (with the file index-async.html(dependencies loaded asynchronously)) in order to start my web project, but my controllers would need some reorganisation. I have now 3 files full of controllers (700+ lines). Is there an elegant way to load my controllers if I reorganize them in 10 files (and more in the future). Also, more files means less merging conflicts (Yeah!!!) Thx in advance

Original source