1- For help getting started with a new Angular app, check out the [ Angular CLI] ( https://cli.angular.io/ ) .
1+ For help getting started with a new Angular app, check out the
2+ [ Angular CLI] ( https://cli.angular.io/ ) .
23
34For existing apps, follow these steps to begin using Angular Material.
45
5- ## Step 1: Install Angular Material
6+ ## Step 1: Install Angular Material
67
78``` bash
89npm install --save @angular/material
910```
1011
11- ## Step 2: Import the Module
12-
13- Add MaterialModule as an import in your app's root NgModule.
14-
12+ ## Step 2: Animations
13+
14+ Some Material components depend on the Angular animations module in order to be able to do
15+ more advanced transitions. If you want these animations to work in your app, you have to
16+ install the ` @angular/animations ` module and include the ` BrowserAnimationsModule ` in your app.
17+
18+ ``` bash
19+ npm install --save @angular/animations
20+ ```
21+
1522``` ts
16- import { MaterialModule } from ' @angular/material' ;
17-
23+ import {BrowserAnimationsModule } from ' @angular/platform-browser/animations' ;
24+
25+ @NgModule ({
26+ ...
27+ imports : [BrowserAnimationsModule ],
28+ ...
29+ })
30+ export class PizzaPartyAppModule { }
31+ ```
32+
33+ If you don't want to add another dependency to your project, you can use the ` NoopAnimationsModule ` .
34+
35+ ``` ts
36+ import {NoopAnimationsModule } from ' @angular/platform-browser/animations' ;
37+
38+ @NgModule ({
39+ ...
40+ imports : [NoopAnimationsModule ],
41+ ...
42+ })
43+ export class PizzaPartyAppModule { }
44+ ```
45+
46+ ## Step 3: Import the Module
47+
48+ Add MaterialModule as an import in your app's root NgModule.
49+
50+ ``` ts
51+ import {MaterialModule } from ' @angular/material' ;
52+
1853@NgModule ({
1954 ...
2055 imports : [MaterialModule ],
@@ -23,9 +58,9 @@ import { MaterialModule } from '@angular/material';
2358export class PizzaPartyAppModule { }
2459```
2560
26- ## Step 3 : Include Theming
61+ ## Step 4 : Include Theming
2762
28- Including a theme is ** required** to apply all of the core and theme styles to your application.
63+ Including a theme is ** required** to apply all of the core and theme styles to your application.
2964
3065To get started with a prebuilt theme, include the following in your app's index.html:
3166
@@ -35,16 +70,17 @@ To get started with a prebuilt theme, include the following in your app's index.
3570
3671Note that your app's project structure may have a different relative location for your node_modules.
3772
38- For more information on theming and instructions on how to create a custom theme, see the [ theming guide] ( ./theming.md ) .
73+ For more information on theming and instructions on how to create a custom theme, see the
74+ [ theming guide] ( ./theming.md ) .
3975
40- ## Step 4 : Gesture Support
76+ ## Step 5 : Gesture Support
4177
42- Some components (` md-slide-toggle ` , ` md-slider ` , ` mdTooltip ` ) rely on
78+ Some components (` md-slide-toggle ` , ` md-slider ` , ` mdTooltip ` ) rely on
4379[ HammerJS] ( http://hammerjs.github.io/ ) for gestures. In order to get the full feature-set of these
4480components, HammerJS must be loaded into the application.
4581
46- You can add HammerJS to your application via [ npm] ( https://www.npmjs.com/package/hammerjs ) , a CDN
47- (such as the [ Google CDN] ( https://developers.google.com/speed/libraries/#hammerjs ) ), or served
82+ You can add HammerJS to your application via [ npm] ( https://www.npmjs.com/package/hammerjs ) , a CDN
83+ (such as the [ Google CDN] ( https://developers.google.com/speed/libraries/#hammerjs ) ), or served
4884directly from your app.
4985
5086To install via npm, use the following command:
@@ -57,22 +93,25 @@ After installing, import it on your app's root module.
5793import ' hammerjs' ;
5894```
5995
60- ## Step 5 (Optional): Add Material Icons
96+ ## Step 6 (Optional): Add Material Icons
97+
98+ If you want your ` md-icon ` components to use [ Material Icons] ( https://material.io/icons/ ) ,
99+ load the font in your ` index.html ` .
61100
62- If you want your ` md-icon ` components to use [ Material Icons] ( https://material.io/icons/ ) , load the font in your ` index.html ` .
63-
64101``` html
65102<link href =" https://fonts.googleapis.com/icon?family=Material+Icons" rel =" stylesheet" >
66103```
67104
68- For more information on using Material Icons, check out the [ Material Icons Guide] ( https://google.github.io/material-design-icons/ ) .
105+ For more information on using Material Icons, check out the
106+ [ Material Icons Guide] ( https://google.github.io/material-design-icons/ ) .
107+
108+ Note that ` md-icon ` has support for any font or svg icons, so using Material Icons is
109+ just one option.
69110
70- Note that ` md-icon ` has support for any font or svg icons, so using Material Icons is just one option.
71-
72111
73112## Configuring SystemJS
74113
75- If your project is using SystemJS for module loading, you will need to add ` @angular/material `
114+ If your project is using SystemJS for module loading, you will need to add ` @angular/material `
76115to the SystemJS configuration:
77116
78117``` js
0 commit comments