0
votes

I'm looking at this open source project bounty source's angularjs app.

I need some clarifications:

  1. How does angular.js know where to lookup the modules?

    angular.module('constants', []); angular.module('filters', []); angular.module('directives', []); angular.module('services', []); angular.module('factories', []); angular.module('resources', []); angular.module('bountysource', ['constants', 'services', 'directives', 'filters', 'factories', 'resources']);

    angular.module('activity', ['bountysource']); angular.module('fundraisers', ['bountysource']); angular.module('teams', ['bountysource']);

https://github.com/bountysource/frontend/blob/master/src/app/app.js#L29

The modules constants, filters, etc are in the /src/common folder

  1. I only see the main AppController defined in the app.js file, how do the other controller's get loaded or is there a convention?

https://github.com/bountysource/frontend/blob/master/src/app/app.js#L69

Not only the controllers, but what about the routes.js file?

Or does this all just work b/c when the project gets build using gruntjs it combines all of this to a single file?

1
I didn't look at the source but their build system probably concatenates the js files together and injects the new file into the html. - Neil Smith

1 Answers