When I try to implement ngx-gallery in Angular 8. I found some strange error message:
Class constructor HammerGestureConfig cannot be invoked without 'new'
My first though there's something happen in Angular or ngx-bootsrap version. But, after some debug, definitely it's version problems and we can add same patch solution from github and stackoverflow. This is the full documentation:
- Go To app.module.ts
- add this code:
export class CustomHammerConfig extends HammerGestureConfig {
overrides = {
pinch: { enable: false },
rotate: { enable: false },
};
}
- apply this patch in your providers app.module.ts
providers: [
{
provide: HAMMER_GESTURE_CONFIG, useClass: CustomHammerConfig
}
],
- Add Import if necessary
import { BrowserModule, HAMMER_GESTURE_CONFIG, HammerGestureConfig } from '@angular/platform-browser';
Hope it works !!!