feat(platform-browser): fix #19604, can config hammerOptions (#21979)

PR Close #21979
This commit is contained in:
JiaLi.Passion 2018-02-02 10:08:17 +09:00 committed by Matias Niemelä
parent 3a0b5a928c
commit 1d571b299d
2 changed files with 20 additions and 1 deletions

View File

@ -72,8 +72,17 @@ export class HammerGestureConfig {
overrides: {[key: string]: Object} = {};
options?: {
cssProps?: any; domEvents?: boolean; enable?: boolean | ((manager: any) => boolean);
preset?: any[];
touchAction?: string;
recognizers?: any[];
inputClass?: any;
inputTarget?: EventTarget;
};
buildHammer(element: HTMLElement): HammerInstance {
const mc = new Hammer(element);
const mc = new Hammer(element, this.options);
mc.get('pinch').set({enable: true});
mc.get('rotate').set({enable: true});

View File

@ -53,6 +53,16 @@ export declare const HAMMER_GESTURE_CONFIG: InjectionToken<HammerGestureConfig>;
/** @experimental */
export declare class HammerGestureConfig {
events: string[];
options?: {
cssProps?: any;
domEvents?: boolean;
enable?: boolean | ((manager: any) => boolean);
preset?: any[];
touchAction?: string;
recognizers?: any[];
inputClass?: any;
inputTarget?: EventTarget;
};
overrides: {
[key: string]: Object;
};