Skip to content

Commit

Permalink
feat(platform-browser): fix angular#19604, can config hammerOptions (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaLiPassion authored and matsko committed Feb 14, 2018
1 parent 3a0b5a9 commit 1d571b2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/platform-browser/src/dom/events/hammer_gestures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand Down
10 changes: 10 additions & 0 deletions tools/public_api_guard/platform-browser/platform-browser.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit 1d571b2

Please sign in to comment.