| [ Web Proxy ] |
| Viewing: https://riptutorial.com/angularjs/example/22024/using-dependency-injection | [Back] [Original] |
[logo rip]
The following syntax allows you to specify dependencies in your module.js instead of explicit specification when using the service
//lazy_module.js
angular.module('lazy', [
'alreadyLoadedDependency1',
'alreadyLoadedDependency2',
...
[
'path/to/lazily/loaded/dependency.js',
'path/to/lazily/loaded/dependency.css'
]
]);
Note: this syntax will only work for lazily loaded modules!
| Web Proxy Viewer | New URL | Original Page |