官术网_书友最值得收藏!

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 {}
主站蜘蛛池模板: 社旗县| 乌鲁木齐市| 安丘市| 曲麻莱县| 朝阳区| 伊川县| 峨眉山市| 加查县| 新巴尔虎右旗| 宜兴市| 临朐县| 德兴市| 沅江市| 大同市| 吕梁市| 闵行区| 东台市| 安达市| 建昌县| 集贤县| 封丘县| 东源县| 恩施市| 横峰县| 偏关县| 临西县| 高平市| 陕西省| 乐业县| 光泽县| 阜城县| 湘潭市| 绥中县| 岳阳县| 拉萨市| 长丰县| 当阳市| 大厂| 广德县| 定结县| 化隆|