Skip to content

Commit e22f46b

Browse files
crisbetojelbourn
authored andcommitted
build: hammer gestures not working in lazy-loaded modules (#15589)
Fixes the Hammer.js gestures not working after the switch to lazy-loaded modules.
1 parent 3a5d342 commit e22f46b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/dev-app/dev-app/dev-app-module.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ import {
1313
MatIconModule,
1414
MatListModule,
1515
MatSidenavModule,
16-
MatToolbarModule
16+
MatToolbarModule,
17+
GestureConfig
1718
} from '@angular/material';
1819
import {RouterModule} from '@angular/router';
20+
import {HAMMER_GESTURE_CONFIG} from '@angular/platform-browser';
1921
import {DevApp404} from './dev-app-404';
2022
import {DevAppHome} from './dev-app-home';
2123
import {DevAppLayout} from './dev-app-layout';
@@ -32,6 +34,10 @@ import {DevAppLayout} from './dev-app-layout';
3234
],
3335
declarations: [DevAppLayout, DevAppHome, DevApp404],
3436
exports: [DevAppLayout],
37+
38+
// We need to pass this in here, because the gesture config currently doesn't for lazy-loaded
39+
// modules. See https://github.com/angular/material2/issues/4595#issuecomment-416641018.
40+
providers: [{provide: HAMMER_GESTURE_CONFIG, useClass: GestureConfig}]
3541
})
3642
export class DevAppModule {
3743
}

0 commit comments

Comments
 (0)