Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 23, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 6 additions & 18 deletions guides/getting-started.md
Original file line number Diff line number Diff line change
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
```

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