can not find module "@angular/material"
That's what solved this problem for me.
I used:
npm install --save @angular/material @angular/cdk
npm install --save @angular/animations
but INSIDE THE APPLICATION'S FOLDER.
Source: https://medium.com/@ismapro/first-steps-with-angular-cli-and-angular-material-5a90406e9a4
Follow these steps to begin using Angular Material.
Step 1: Install Angular Material
npm install --save @angular/material
Step 2: Animations
Some Material components depend on the Angular animations module in order to be able to do more advanced transitions. If you want these animations to work in your app, you have to install the @angular/animations
module and include the BrowserAnimationsModule in your app.
npm install --save @angular/animations
Then
import {BrowserAnimationsModule} from '@angular/platform browser/animations';
@NgModule({
...
imports: [BrowserAnimationsModule],
...
})
export class PizzaPartyAppModule { }
Step 3: Import the component modules
Import the NgModule for each component you want to use:
import {MdButtonModule, MdCheckboxModule} from '@angular/material';
@NgModule({
...
imports: [MdButtonModule, MdCheckboxModule],
...
})
export class PizzaPartyAppModule { }
be sure to import the Angular Material modules after Angular's BrowserModule, as the import order matters for NgModules
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MdCardModule} from '@angular/material';
@NgModule({
declarations: [
AppComponent,
HeaderComponent,
HomeComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
MdCardModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Step 4: Include a theme
Including a theme is required to apply all of the core and theme styles to your application.
To get started with a prebuilt theme, include the following in your app's index.html:
<link href="../node_modules/@angular/material/prebuilt-themes/indigo-pink.css" rel="stylesheet">