Questions such as this one, and various blog posts, recommend a separate module to import your Material Modules and immediately export them, then import that module into your app.module.ts
to prevent polluting the app module.
It seems to me that if imports are always identical to exports then I would prefer to declare them only once. So, I use
const materialModules = [
MatButtonModule, MatIconModule, MatFormFieldModule, MatInputModule, MatNativeDateModule, MatDatepickerModule,
MatCheckboxModule, MatSidenavModule, MatToolbarModule,
];
@NgModule({
imports: materialModules,
exports: materialModules,
})
export class MaterialModule{}
This works fine, but I would like to give a type to materialModules
. What should it be?