Touch events / Gestures

Angular supports Hammer.JS gestures.

Applications need to include the HammerJS script itself.

npm install hammerjs

Import to main.ts file:

import 'hammerjs';

Import HammerModule at the root of your application so that Angular can work with HammerJS to detect gesture events.

After that you will be able to bind gesture events.

<div (swipe)="swipeHandler()">
  Swipe me!
export class AppComponent {
  swipeHandler() {
    alert('Swipe handled!');
Swipe me!
Links & Tutorials