Question

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

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top