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

Injecting NgModules and module initialization

Angular instantiates NgModules and registers them with dependency injection. This means that you can inject modules into other modules or components, like this:

@NgModule({
imports: [TalksModule]
})
class AppModule {
constructor(t: TalksModule) {}
}

This can be useful for coordinating the initialization of multiple modules, as shown here:

@NgModule({
imports: [ModuleA, ModuleB]
})
class AppModule {
constructor(a: ModuleA, b: ModuleB) {
a.initialize().then(() => b.initialize());
}
}
主站蜘蛛池模板: 盐山县| 德化县| 许昌市| 吉木乃县| 益阳市| 吴堡县| 镇平县| 乌海市| 织金县| 永清县| 淳化县| 三亚市| 托里县| 镇原县| 侯马市| 卫辉市| 页游| 临城县| 鄂尔多斯市| 大姚县| 多伦县| 镇康县| 四子王旗| 孝感市| 皮山县| 抚宁县| 五寨县| 南城县| 五莲县| 武城县| 霍林郭勒市| 怀化市| 九龙城区| 青冈县| 青阳县| 衡山县| 仲巴县| 鲁山县| 井冈山市| 枣强县| 廉江市|