0

I just upgraded to Alpha 7 and after upgrade Slide Toggle seems to be broken.

When I compile my project in Visual Studio 2015 I receive the below errors:

Error       Build:Cannot find name 'HammerInput'.   node_modules\@angular2-material\slide-toggle\slide-toggle.d.ts  67  

Error   TS2304  Cannot find name 'HammerInput'. TypeScript Virtual Projects node_modules\@angular2-material\slide-toggle\slide-toggle.d.ts  67

Apparently it seems that the below line is causing the problem in slide-toggle.d.ts:

_onDrag(event: HammerInput): void;
Naveed Ahmed
  • 10,048
  • 12
  • 46
  • 85

1 Answers1

2

Thank you everyone installing typings through command:

npm install --save hammerjs @types/hammerjs

and then importing it in main file solved the issue.:

/// <reference path="../typings/globals/hammerjs/index.d.ts" />

For more details, please have a look at:

https://github.com/angular/material2/issues/977#issuecomment-238946558

Naveed Ahmed
  • 10,048
  • 12
  • 46
  • 85
  • better add `"types": ["hammerjs"]` to tsconfig.json isntead of putting the reference path in the template – j2L4e Aug 19 '16 at 07:42