Within a utilities folder, I set up a custom material module.
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { BrowserAnimationsModule,NoopAnimationsModule } from
'@angular/platform-browser/animations';
import {
MatButtonModule,
MatCheckboxModule,
MatFormFieldModule,
MatDialogModule,
MatTabsModule,
MatProgressSpinnerModule,
MatMenuModule,
MatIconModule,
MatInputModule,
MatSelectModule,
MatToolbarModule,
MatCardModule,
MatChipsModule,
MatListModule,
MatTooltipModule,
MatNativeDateModule,
MatDatepickerModule,
MatTableModule,
MatPaginatorModule,
MatProgressBarModule,
MatSortModule,
MatSnackBarModule,
MatStepperModule,
MatGridListModule,
MatExpansionModule,
MatRadioModule,
MatBadgeModule
} from '@angular/material';
import {BrowserModule} from '@angular/platform-browser';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {DomSanitizer} from '@angular/platform-browser';
import {MatIconRegistry} from '@angular/material';
@NgModule({
imports: [
FormsModule,
ReactiveFormsModule,
BrowserAnimationsModule,
MatButtonModule,
MatCheckboxModule,
MatFormFieldModule,
MatDialogModule,
MatTabsModule,
MatProgressSpinnerModule,
MatMenuModule,
MatIconModule,
MatInputModule,
MatSelectModule,
MatToolbarModule,
MatCardModule,
MatChipsModule,
MatListModule,
MatTooltipModule,
MatNativeDateModule,
MatDatepickerModule,
MatTableModule,
MatPaginatorModule,
MatProgressBarModule,
MatSortModule,
MatSnackBarModule,
MatStepperModule,
MatGridListModule,
MatBadgeModule,
MatExpansionModule,
MatRadioModule,
MatBadgeModule
],
exports: [
BrowserAnimationsModule,
MatButtonModule,
MatFormFieldModule,
MatCheckboxModule,
MatTabsModule,
MatProgressSpinnerModule,
MatMenuModule,
MatIconModule,
MatInputModule,
MatSelectModule,
MatToolbarModule,
MatCardModule,
MatChipsModule,
MatListModule,
MatTooltipModule,
MatNativeDateModule,
MatDatepickerModule,
MatTableModule,
MatPaginatorModule,
MatProgressBarModule,
MatSortModule,
MatSnackBarModule,
MatStepperModule,
MatGridListModule,
MatBadgeModule,
MatExpansionModule,
MatRadioModule,
MatBadgeModule
],
declarations: []
})
export class CustommaterialModule {
constructor(iconRegistry: MatIconRegistry, sanitizer:DomSanitizer)
{
iconRegistry.addSvgIcon(
'linkedin',
sanitizer.bypassSecurityTrustResourceUrl('../../assets/icons/linkedin.svg'));
}
}