Open ItaiBarkav opened 10 months ago
Have you tried adding this to providers in app.config.ts?
{
provide: HAMMER_GESTURE_CONFIG,
useClass: HammerGestureConfig,
},
You should install hammerjs yourself:
npm install hammerjs
and then get it to load in the app.conifg.ts:
{
provide: HAMMER_LOADER,
useValue: () => import('hammerjs')
},
I placed the import just before importProvidersFrom(HammerModule). No need to import things in your component.
The solution for me was this: https://angular.io/api/platform-browser/HammerModule
Everything now works!
Hello, I'm trying to use HammerJS in my angular17 project.
I import it in my
app.config.ts
file:And also I'm my component:
I tried this and this not working for me and I get this error in the console:
The "swipeleft" event cannot be bound because Hammer.JS is not loaded and no custom loader has been specified
I will thank for any help to solve this problem