Skip to content

Instantly share code, notes, and snippets.

@pimatco
Last active September 17, 2024 21:54
Show Gist options
  • Save pimatco/d5b1891feb90b60ca4681011b6513873 to your computer and use it in GitHub Desktop.
Save pimatco/d5b1891feb90b60ca4681011b6513873 to your computer and use it in GitHub Desktop.
All Angular Material Components Imports from app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
//Angular Material Components
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MatCheckboxModule} from '@angular/material';
import {MatButtonModule} from '@angular/material';
import {MatInputModule} from '@angular/material/input';
import {MatAutocompleteModule} from '@angular/material/autocomplete';
import {MatDatepickerModule} from '@angular/material/datepicker';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatRadioModule} from '@angular/material/radio';
import {MatSelectModule} from '@angular/material/select';
import {MatSliderModule} from '@angular/material/slider';
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import {MatMenuModule} from '@angular/material/menu';
import {MatSidenavModule} from '@angular/material/sidenav';
import {MatToolbarModule} from '@angular/material/toolbar';
import {MatListModule} from '@angular/material/list';
import {MatGridListModule} from '@angular/material/grid-list';
import {MatCardModule} from '@angular/material/card';
import {MatStepperModule} from '@angular/material/stepper';
import {MatTabsModule} from '@angular/material/tabs';
import {MatExpansionModule} from '@angular/material/expansion';
import {MatButtonToggleModule} from '@angular/material/button-toggle';
import {MatChipsModule} from '@angular/material/chips';
import {MatIconModule} from '@angular/material/icon';
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
import {MatProgressBarModule} from '@angular/material/progress-bar';
import {MatDialogModule} from '@angular/material/dialog';
import {MatTooltipModule} from '@angular/material/tooltip';
import {MatSnackBarModule} from '@angular/material/snack-bar';
import {MatTableModule} from '@angular/material/table';
import {MatSortModule} from '@angular/material/sort';
import {MatPaginatorModule} from '@angular/material/paginator';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
BrowserAnimationsModule,
MatCheckboxModule,
MatCheckboxModule,
MatButtonModule,
MatInputModule,
MatAutocompleteModule,
MatDatepickerModule,
MatFormFieldModule,
MatRadioModule,
MatSelectModule,
MatSliderModule,
MatSlideToggleModule,
MatMenuModule,
MatSidenavModule,
MatToolbarModule,
MatListModule,
MatGridListModule,
MatCardModule,
MatStepperModule,
MatTabsModule,
MatExpansionModule,
MatButtonToggleModule,
MatChipsModule,
MatIconModule,
MatProgressSpinnerModule,
MatProgressBarModule,
MatDialogModule,
MatTooltipModule,
MatSnackBarModule,
MatTableModule,
MatSortModule,
MatPaginatorModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
@jstmeh
Copy link

jstmeh commented Aug 4, 2020

awesome, time saver !

@Kexplx
Copy link

Kexplx commented Aug 13, 2020

Thank you!

import {MatCheckboxModule} from '@angular/material';
import {MatButtonModule} from '@angular/material';

should be

import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatButtonModule } from '@angular/material/button';

@rajasharma1603
Copy link

Thank you!

import {MatCheckboxModule} from '@angular/material';
import {MatButtonModule} from '@angular/material';

should be

import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatButtonModule } from '@angular/material/button';

I have created a single module file to Import all the latest Material Modules at once,
Hope it helps!

You may Check
https://gist.github.com/rajasharma1603/8bdf9c11e28615364dffbb6c85360c43

THIS WAS CREATED FOR ANGULAR MATERIAL 9.2.0

@rajasharma1603
Copy link

@pimatco Thanks for this also update Line 9 and 10 to :

import {MatCheckboxModule} from '@angular/material/checkbox';
import {MatButtonModule} from '@angular/material/button';

I have created a single module file to Import all the latest Material Modules at once,
Hope it helps!

You may Check
https://gist.github.com/rajasharma1603/8bdf9c11e28615364dffbb6c85360c43

THIS WAS CREATED FOR ANGULAR MATERIAL 9.2.0

@zimejin
Copy link

zimejin commented Aug 27, 2020

Wow! thanks for this.

@stefan4h
Copy link

import {MatBadgeModule} from '@angular/material/badge';

is missing

@DiegoDoniss
Copy link

Thanks

@nelliesnoodles
Copy link

thank you!

@devanshee26
Copy link

Wonderful😃😃!

@garraflavatra
Copy link

Thanks! Saved me a lot of work...

@VamanPatel
Copy link

**_thank you very much, I was facing lots of errors....now soled thanks

bro_**

@kkwrecks
Copy link

kkwrecks commented Jul 7, 2021

Thank you I really appreciate this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment