import { CommonModule } from '@angular/common' ; import { NgModule , Optional , SkipSelf } from '@angular/core' ; import { MatButtonModule , MatIconModule , MatSnackBarModule , MatToolbarModule } from '@angular/material' ; import { RouterModule } from '@angular/router' ; import { throwIfAlreadyLoaded } from './module-import-check' ; import { ToolbarComponent } from './toolbar/toolbar.component' ; @ NgModule ( { imports : [ CommonModule , MatButtonModule , MatIconModule , MatSnackBarModule , MatToolbarModule , RouterModule ] , declarations : [ ToolbarComponent ] , exports : [ ToolbarComponent ] } ) export class CoreModule { constructor ( @ Optional ( ) @ SkipSelf ( ) parentModule ) { throwIfAlreadyLoaded ( parentModule , 'CoreModule' ) ; } }