{ "id": "api/platform-browser/HammerGestureConfig", "title": "HammerGestureConfig", "contents": "\n\n
\n
\n
\n \n API > @angular/platform-browser\n
\n \n
\n \n
\n

HammerGestureConfiglink

\n \n \n \n \n \n
\n \n \n\n
\n \n
\n

An injectable HammerJS Manager\nfor gesture recognition. Configures specific event recognition.

\n\n \n
\n \n \n \n
\n\nclass HammerGestureConfig {\n events: string[]\n overrides: {...}\n options?: {...}\n buildHammer(element: HTMLElement): HammerInstance\n}\n\n\n \n \n\n
\n\n\n \n\n \n \n \n\n\n\n\n\n\n\n\n
\n

Propertieslink

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
PropertyDescription
\n \n events: string[]\n \n \n

A set of supported event names for gestures to be used in Angular.\nAngular supports all built-in recognizers, as listed in\nHammerJS documentation.

\n\n \n
\n \n overrides: {\n [key: string]: Object;\n}\n \n \n

Maps gesture event names to a set of configuration options\nthat specify overrides to the default values for specific properties.

\n\n

The key is a supported event name to be configured,\nand the options object contains a set of properties, with override values\nto be applied to the named recognizer event.\nFor example, to disable recognition of the rotate event, specify\n{\"rotate\": {\"enable\": false}}.

\n

Properties that are not present take the HammerJS default values.\nFor information about which properties are supported for which events,\nand their allowed and default values, see\nHammerJS documentation.

\n\n
\n \n options?: {\n cssProps?: any;\n domEvents?: boolean;\n enable?: boolean | ((manager: any) => boolean);\n preset?: any[];\n touchAction?: string;\n recognizers?: any[];\n inputClass?: any;\n inputTarget?: EventTarget;\n}\n \n \n

Properties whose default values can be overridden for a given event.\nDifferent sets of properties apply to different events.\nFor information about which properties are supported for which events,\nand their allowed and default values, see\nHammerJS documentation.

\n\n \n
\n
\n\n\n\n
\n

Methodslink

\n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n\n \n \n
\n
\n

\n buildHammer()\n \n link

\n \n
\n
\n

Creates a HammerJS Manager\nand attaches it to a given HTML element.

\n\n
\n
\n \n\n buildHammer(element: HTMLElement): HammerInstance\n\n \n\n
Parameters
\n \n \n \n \n \n \n \n \n \n
\n \n element\n HTMLElement\n

The element that will recognize gestures.

\n\n
\n\n \n
Returns
\n

HammerInstance: A HammerJS event-manager object.

\n\n \n\n\n \n\n \n
\n
\n\n \n
\n\n\n\n \n\n\n
\n
\n\n\n" }