Get started with Angular Material 2 using the Angular CLI.
npm install -g angular-cli
ng new my-project
The new command creates a project with a build system for your Angular app.
npm install --save @angular/material
src/app/app.module.ts
import { MaterialModule } from '@angular/material';
// other imports
@NgModule({
imports: [MaterialModule.forRoot()],
...
})
export class PizzaPartyAppModule { }
See the theming guide for more information.
The slide-toggle and slider components have a dependency on HammerJS.
Add HammerJS to your application via npm, a CDN (such as the Google CDN), or served directly from your app.
- If you want to use Material Design icons, load the Material Design font in your
index.html
.
md-icon
supports any font icons or svg icons, so this is only one potential option.
src/index.html
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">