[class] KitHammerProvider


Provided in:'root'

Provides Hammer.JS instance if available.

Also you can manually inject HammerJS instance in the root module:

import * as Hammer from 'hammerjs';
import { kitHammerInstance } from '@ngx-kit/core';
  providers: [
      provide: kitHammerInstance,
      useValue: Hammer,

But be aware, Hammer.JS does not support server-side rendering.

That's why it is better just to add it via angular.json scripts section:

"scripts": [


get hammer()

Get Hammer.JS. Returns null if not available.

calcRelatedPosition(el: HTMLElement, center: {x: number, y: number}): {x: number, y: number}

Get event position relative to passed element, not the viewport.