- Essential Angular
- Victor Savkin Jeff Cross
- 70字
- 2021-07-02 22:56:27
Providers
I'll cover providers and dependency injection in Chapter 5, Dependency Injection. Here I'd like to just note that NgModules can contain providers. And the providers of the imported modules are merged with the target module's providers, left to right, that is, if multiple imported modules define the same provider, the last module wins.
@NgModule({
providers: [
Repository
]
})
class TalksModule {}
@NgModule({
imports: [TalksModule]
})
class AppModule {}
推薦閱讀
- Learning Docker
- Rust實戰(zhàn)
- 編寫高質(zhì)量代碼:改善C程序代碼的125個建議
- Learn React with TypeScript 3
- Python算法從菜鳥到達人
- C語言程序設計
- Java:High-Performance Apps with Java 9
- 深入分布式緩存:從原理到實踐
- 從零開始學Linux編程
- Test-Driven Machine Learning
- 軟件測試教程
- Cocos2d-x Game Development Blueprints
- Python Machine Learning Blueprints:Intuitive data projects you can relate to
- WildFly Cookbook
- Instant Apache Camel Messaging System