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.

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