- 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 {}
推薦閱讀
- Java逍遙游記
- Java面向對象思想與程序設計
- Wireshark Network Security
- C語言程序設計
- PostgreSQL 11從入門到精通(視頻教學版)
- Building Mapping Applications with QGIS
- ASP.NET 3.5程序設計與項目實踐
- Android底層接口與驅動開發技術詳解
- 小學生C++創意編程(視頻教學版)
- Python深度學習原理、算法與案例
- ArcGIS for Desktop Cookbook
- Building Dynamics CRM 2015 Dashboards with Power BI
- 數據分析與挖掘算法:Python實戰
- JavaScript高級程序設計(第4版)
- Python實戰指南:手把手教你掌握300個精彩案例