Skip to content

Latest commit

 

History

History
59 lines (42 loc) · 1.58 KB

GETTING_STARTED.md

File metadata and controls

59 lines (42 loc) · 1.58 KB

Get started with Angular Material 2 using the Angular CLI.

Install the CLI

npm install -g angular-cli

Create a new project

ng new my-project

The new command creates a project with a build system for your Angular app.

Install Angular Material components

npm install --save @angular/material

Import the Angular Material NgModule

src/app/app.module.ts

import { MaterialModule } from '@angular/material';
// other imports 
@NgModule({
  imports: [MaterialModule.forRoot()],
  ...
})
export class PizzaPartyAppModule { }

Including core and theme styles:

See the theming guide for more information.

Additional setup for md-slide-toggle and md-slider:

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.

[Optional] Using Material Design icons with md-icon:

  • 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">

Sample Angular Material 2 projects