I have an angular 2 project that I've created through Angular CLI. I have followed the instruction on the get started guide on the Angular Material website: https://material.angular.io/guide/getting-started. When I try to use the md-side nav tags, I still do not see the website themed with Angular Material.
My component code:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app works!';
}
Here is my component html code:
<md-sidenav-container>
<md-sidenav>
<!-- sidenav content -->
</md-sidenav>
<!-- primary content -->
</md-sidenav-container>
My app.module.ts:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import {RouterModule} from '@angular/router';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MdButtonModule, MdCheckboxModule} from '@angular/material';
import { AppComponent } from './app.component';
import { QuillEditorComponent } from './quill-editor/quill-editor.component';
import { LoginScreenComponent } from './login-screen/login-screen.component';
import { WelcomeScreenComponent } from './welcome-screen/welcome-screen.component';
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
import 'hammerjs';
@NgModule({
declarations: [
AppComponent,
QuillEditorComponent,
LoginScreenComponent,
WelcomeScreenComponent,
PageNotFoundComponent,
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
BrowserAnimationsModule,
MdButtonModule,
MdCheckboxModule,
RouterModule.forRoot([
{path: 'welcome', component: WelcomeScreenComponent},
{path: 'login', component: LoginScreenComponent},
{path: '', redirectTo: 'welcome', pathMatch: 'full'},
{path: '**', component: PageNotFoundComponent},
]),
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
My package.json:
{
"name": "valu-app-poc",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.3.0",
"@angular/cdk": "^2.0.0-beta.8",
"@angular/common": "^4.3.0",
"@angular/compiler": "^4.3.0",
"@angular/compiler-cli": "^4.3.0",
"@angular/core": "^4.3.0",
"@angular/forms": "^4.3.0",
"@angular/http": "^4.3.0",
"@angular/material": "^2.0.0-beta.8",
"@angular/platform-browser": "^4.3.0",
"@angular/platform-browser-dynamic": "^4.3.0",
"@angular/platform-server": "^4.3.0",
"@angular/router": "^4.3.0",
"@types/quill": "0.0.31",
"core-js": "^2.4.1",
"hammerjs": "^2.0.8",
"quill": "^1.3.0",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"rxjs": "^5.1.0",
"typescript": "^2.4.1",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "1.0.4",
"@angular/compiler-cli": "^4.3.0",
"@types/jasmine": "2.5.38",
"@types/node": "^6.0.84",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
}
}