npm i --save @angular/material @angular/cdk
npm i --save @angular/material-moment-adapter moment
npm i --save @angular/animations
npm i --save web-animations-js
npm i --save hammerjs
Add this to src/styles.css
.
indigo-pink.css
is the default theme, could change topurple-green.css
,pink-bluegrey.css
,deeppurple-amber.css
as you wish.
@import "~@angular/material/prebuilt-themes/indigo-pink.css";
Add this to src/main.ts
import 'hammerjs';
Add this to src/index.html
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
import these in src/app/app.module.ts
- Be sure to import the Angular Material modules after Angular's
BrowserModule
. - Can choose the modules you want. i.e.
MatButtonModule
,MatCheckboxModule
.
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MatButtonModule, MatCheckboxModule } from '@angular/material';
@NgModule({
...
imports: [
BrowserAnimationsModule,
MatButtonModule,
MatCheckboxModule],
...
})
- MatButtonModule
- MatButtonToggleModule
- MatChipsModule
- MatIconModule
- MatProgressSpinnerModule
- MatProgressBarModule
- MatInputModule
- MatSelectModule
- MatRadioModule
- MatCheckboxModule
- MatDatepickerModule
- MatSlideToggleModule
- MatSliderModule
- MatAutocompleteModule
- MatFormFieldModule
- MatMenuModule
- MatToolbarModule
- MatSidenavModule
- MatCardModule
- MatListModule
- MatDividerModule
- MatGridListModule
- MatTabsModule
- MatExpansionModule
- MatStepperModule
- MatTableModule
- MatSortModule
- MatPaginatorModule
- MatDialogModule
- MatTooltipModule
- MatSnackBarModule