angular injector

 

If the dependency is added to a module, it gets registered on the root injector.

如果依赖添加到module上,那么,这些服务会注册到root injector。

angular每个组件都有对应的injector,然后组成了一个injector tree

详细介绍:https://blog.angularindepth.com/angular-dependency-injection-and-tree-shakeable-tokens-4588a8f70d5d

posted @ 2018-11-18 13:17  Aoeuy  阅读(218)  评论(0编辑  收藏  举报