HammerGestureConfig

An injectable HammerJS Manager for gesture recognition. Configures specific event recognition.

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

属性

属性名类型说明
events

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

overrides

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

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

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

options

Properties whose default values can be overridden for a given event. Different sets of properties apply to different events. For information about which properties are supported for which events, and their allowed and default values, see HammerJS documentation.

方法

Creates a HammerJS Manager and attaches it to a given HTML element.

buildHammer(element: HTMLElement): HammerInstance

参数

element

The element that will recognize gestures.

返回值

HammerInstance: A HammerJS event-manager object.

注解

@Injectable()