I am using @angular-2.0.0-rc.5, @angular2-material 2.0.0-alpha.7-4 & Angular-CLI 1.0.0-beta.11-webpack.2
When I try to compile it throws an error, Cannot find name 'HammerManager'. Please see attached screenshot.
I found some solution for Angular-CLI (non-webpack) version but none for webpack version with.
Any one got this fixed with above setup ?
Here is the solution that worked for me ...
npm install hammerjs --save-dev
npm install @types/hammerjs --save-dev
import 'hammerjs'; (in main.ts)
Thanks to @j2L4e & this answer https://github.com/justindujardin/ng2-material/issues/244#issuecomment-241600752
You'll need to install the missing typings:
npm install @types/hammerjs --save-dev
Then put a reference to the hammerjs typings into your tsconfig.json
:
"types": [
...,
"hammerjs"
]
if that's not enough, also install hammerjs itself via npm:
npm i hammerjs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With