15

I'm using hammerjs for detecting swipe on a small Angular 8 app.

I followed this article - https://medium.com/angular-in-depth/gestures-in-an-angular-application-dde71804c0d0 - and I'm using hammerjs with @angular/platform-browser.

However, when 3 days ago Angular 9 was released - I updated with no issues, but now swiping detection is not working at all :( ... don't see errors or warnings. Also - didn't see any notes for platform-browser changes in the update release notes.

Any ideas what's wrong and how to fix it?

pesho hristov
  • 1,946
  • 1
  • 25
  • 43

1 Answers1

35

I had the same issue and managed to come across this article which has solved my problem.

hammerjs is now optional
In earlier versions hammerjs was required to add gesture support, it is optional now and all implementation used internally is removed, you can use HammerModule from @angular/platform-browser.

Simply adding the HammerModule import to my AppModule fixed it.

Stefan Charsley
  • 1,409
  • 12
  • 13
  • 3
    Thanks a lot, Stefan :) ... I impored HammerModule same way I did for BrowserModule - and it worked like a charm :) Cheers ;) – pesho hristov Feb 10 '20 at 08:24