docs(getting-started): update HammerJS instructions (#2383)

This commit is contained in:
Jeremy Elbourn
2016-12-23 12:11:42 -08:00
committed by GitHub
parent 33b152d703
commit 026c70a0de
+6 -18
View File
@@ -39,10 +39,12 @@ use a pre-built theme, or define your own custom theme.
:trident: See the [theming guide](guides/theming.md) for instructions.
### Additional setup for `md-slide-toggle` and `md-slider`:
The slide-toggle and slider components have a dependency on [HammerJS](http://hammerjs.github.io/).
### Additional setup for gestures
Some components ()`md-slide-toggle`, `md-slider`, `mdTooltip`) rely on
[HammerJS](http://hammerjs.github.io/) for gestures. In order to get the full feature-set of these
components, HammerJS must be loaded into the application.
Add HammerJS to your application via [npm](https://www.npmjs.com/package/hammerjs), a CDN
You can add HammerJS to your application via [npm](https://www.npmjs.com/package/hammerjs), a CDN
(such as the [Google CDN](https://developers.google.com/speed/libraries/#hammerjs)), or served
directly from your app.
@@ -50,28 +52,14 @@ directly from your app.
```bash
npm install --save hammerjs
npm install --save-dev @types/hammerjs
```
Import HammerJS on your app's module.
After installing, import HammerJS on your app's module.
**src/app/app.module.ts**
```ts
import 'hammerjs';
```
Finally, you need to add `hammerjs` to the `types` section of your `tsconfig.json` file:
```json
{
"compilerOptions": {
"types": [
"hammerjs"
]
}
}
```
## Configuring SystemJS
If your project is using SystemJS for module loading, you will need to add `@angular/material`
to the SystemJS configuration: