How does angularjs know to lookup the modules?
I'm looking at this open source project bounty source's angularjs app.
I need some clarifications:
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
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?
They're all included from the index page:
https://github.com/bountysource/frontend/blob/master/src/index.html
链接地址: http://www.djcxy.com/p/77650.html上一篇: 在POST请求的主体中发送数据
下一篇: angularjs如何知道查找模块?