Reputation: 25420
How to deal with this errors of Material 2 for Angular 2:
client:75 [default] /Users/mateo/Desktop/app/client/node_modules/@angular/material/core/gestures/MdGestureConfig.d.ts:4:39
Cannot find name 'HammerManager'.
Upvotes: 1
Views: 241
Reputation: 214295
You can try the following:
1 Install types
for hammerjs:
npm install @types/hammerjs --save-dev
2 Open \node_modules\@angular\material\tsconfig.json
and add installed hammerjs
types to types
array this config:
"types": [
"hammerjs"
]
Upvotes: 2
Reputation: 40936
Basically, you need to install HammerJS
because you're using Material
component that requires it:
npm install hammerjs --save
systemjs.config.js
System.config({
path: {'npm:' : 'node_modules/'},
map: {'hammerjs': 'npm:hammerjs'},
packages: {
'hammerjs': { main: './hammer.js', defaultExtension: 'js'}
}
})
A few Material components (eg: md-slider
) import hammerjs
, so unless it's installed or linked via an external script (as in @Gunter's answer), you will run into problems.
Upvotes: 1