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

猜你喜欢

转载自www.cnblogs.com/aoeuy/p/9977644.html
今日推荐