Skip to content

Commit

Permalink
docs(getting-started): update HammerJS instructions (#2383)
Browse files Browse the repository at this point in the history
  • Loading branch information
jelbourn committed Dec 23, 2016
1 parent 33b152d commit 026c70a
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions guides/getting-started.md
Expand Up @@ -39,39 +39,27 @@ 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.

#### If you want to include HammerJS from npm, you can install it:

```bash
npm install --save hammerjs
npm install --save-dev @types/hammerjs

This comment has been minimized.

Copy link
@daBishMan

daBishMan Dec 23, 2016

I think you need to install the @types

```

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:
Expand Down

0 comments on commit 026c70a

Please sign in to comment.