Tag: dependency-injection
All the articles with the tag "dependency-injection".
[译] 默认具备 Tree-shaking 能力
Published: at 16:10构建 Angular 库时,如何利用 providedIn: 'root' 与 useFactory 让抽象服务默认具备 Tree-shaking 能力,避免把未使用的代码带进最终产物。
[译] 在 Angular 中延迟加载服务并考虑测试
Published: at 14:21我们应该能够模拟我们延迟加载的内容
[译] inject 函数不是服务定位器——除非你把它用成了服务定位器
Published: at 00:00深入探讨 Angular 中 inject() 函数与服务定位器模式的区别,理解注入上下文的基础原理,以及如何避免将 inject() 误用为服务定位器。