- 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 {}
推薦閱讀
- C# 7 and .NET Core Cookbook
- PHP+MySQL網(wǎng)站開(kāi)發(fā)技術(shù)項(xiàng)目式教程(第2版)
- 跟老齊學(xué)Python:輕松入門(mén)
- Instant Typeahead.js
- INSTANT Passbook App Development for iOS How-to
- Visual Basic程序設(shè)計(jì)實(shí)驗(yàn)指導(dǎo)(第二版)
- 第一行代碼 C語(yǔ)言(視頻講解版)
- Android項(xiàng)目實(shí)戰(zhàn):手機(jī)安全衛(wèi)士開(kāi)發(fā)案例解析
- Julia 1.0 Programming Complete Reference Guide
- Delphi開(kāi)發(fā)典型模塊大全(修訂版)
- Modernizing Legacy Applications in PHP
- Python編程快速上手2
- SQL Server 2008實(shí)用教程(第3版)
- 軟硬件綜合系統(tǒng)軟件需求建模及可靠性綜合試驗(yàn)、分析、評(píng)價(jià)技術(shù)
- Apache Kafka 1.0 Cookbook