- 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 {}
推薦閱讀
- Cocos2d Cross-Platform Game Development Cookbook(Second Edition)
- The Android Game Developer's Handbook
- Mastering QGIS
- Vue.js入門與商城開發實戰
- WebRTC技術詳解:從0到1構建多人視頻會議系統
- 數據結構案例教程(C/C++版)
- Scala程序員面試算法寶典
- C++新經典
- 實戰Java高并發程序設計(第2版)
- Fastdata Processing with Spark
- Practical Microservices
- Julia數據科學應用
- 軟件工程與UML案例解析(第三版)
- Greenplum構建實時數據倉庫實踐
- 分布式數據庫HBase案例教程