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

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top