为什么BrowserModule和HttpClientModule没有实现NgModule接口?

时间:2017-11-06 14:53:44

标签: angular angular-httpclient

刚发现BrowserModule和HttpClientModule没有实现NgModule接口。有人可以解释一下原因吗?

更新:我尝试解决的实际问题是提取 import 部分以分离我可以根据特定规则创建的数组。因此,想法是来指定此数组的类型。我不想把any放在这里:

const importedModules: any[] = [
   BrowserModule,
   HttpClientModule,
   FormsModule,
   SharedModule,
   ...
];

if (!environment.production) {
  importedModules.push(StoreDevtoolsModule.instrument());
}

@NgModule({
   //...
   imports: importedModules,
   //...
})

0 个答案:

没有答案