Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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 { }
@Mahboub99
Copy link

Mahboub99 commented Jun 27, 2020

thanks man

@saipavanjonnavithula
Copy link

saipavanjonnavithula commented Jun 28, 2020

excellent.. very helpful.. thank you

@pmutua
Copy link

pmutua commented Jul 12, 2020

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

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

@atprogrammerashu
Copy link

atprogrammerashu commented Jul 22, 2020

Very helpfull bro

@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

rajasharma1603 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';

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

rajasharma1603 commented Aug 13, 2020

@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.

@batchgott
Copy link

batchgott commented Sep 18, 2020

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

is missing

@DiegoDoniss
Copy link

DiegoDoniss commented Sep 24, 2020

Thanks

@nelliesnoodles
Copy link

nelliesnoodles commented Jan 29, 2021

thank you!

@devanshee26
Copy link

devanshee26 commented Feb 2, 2021

Wonderful😃😃!

@garraflavatra
Copy link

garraflavatra commented Mar 27, 2021

Thanks! Saved me a lot of work...

@VamanPatel
Copy link

VamanPatel commented Jul 1, 2021

**_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