传统的 angular 应用不支持异步加载模块,必须在 module 启动的时候,所有模块必须预加载进来。 通过使用 angular-async-loader 库,我们可以使用 requirejs 等加载器,在 module 初始化之后,在动态异步加载其他的 Controller, Services, Filters 等等......
See https://github.com/subchen/angular-async-loader
angular-async-loader
An async loader for angular 1.x application.
Support following components to dynamic register:
.controller
.services
.filter
.directive
.value
.constant
.provider
.decorator
Support following amd/cmd loaders:
Require.js
Sea.js
System.js
Support controllerUrl/denpendencies
config in angular-ui-router
and angular-route
: