There are 2 ways to solve this problem:
-
Either include the (main) import in your main module’s file or
polyfills.ts
:import 'hammerjs';
-
Or include the script from a CDN into your
index.html
file:<head> <!-- ... --> <script src="https://cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.8/hammer.min.js"></script> <!-- ... --> </head>