Reputation: 666
I am trying to import the angular material module into my app. I have done the next things: installed the angular material
yarn add @angular/material
included nesesary modules
@NgModule({
imports: [
DevizionSharedModule,
BrowserAnimationsModule,
MdCardModule,
MdTabsModule,
Included teh defoult styles in my vendor.scss @import '~@angular/material/prebuilt-themes/indigo-pink.css';
But it does not seems to work, what am i missing?
Upvotes: 2
Views: 1862
Reputation: 665
Add material and hammerjs
yarn add @angular/material hammerjs (yarn install if required)
Material should be: "@angular/material": "^2.0.0-beta.2" version
Import material module and hammerjs in every entity module
"import { MaterialModule } from '@angular/material';
import 'hammerjs';"
Add material module in imports array
Upvotes: 3
Reputation: 305
import angular material module in your app.module.ts and add it in the imports metadata:
import { MaterialModule } from '@angular/material';
then add it to the imports metadata:
imports: [
MaterialModule,
.....
]
Also add this line in your global scss file :
@import '~@angular/material/core/theming/all-theme';
@include mat-core();
Also you may need to add this stylesheet in index.html to use the material icons in your app:
<link rel='stylesheet' href='https://fonts.googleapis.com/icon?family=Material+Icons'>
Upvotes: 2