cubiq / iscroll

Smooth scrolling for the web
http://iscrolljs.com
MIT License
12.87k stars 3.8k forks source link

About IScroll #1090

Closed psampath243 closed 8 years ago

psampath243 commented 8 years ago

I have added the Iscroll plugin to my project and it started working as expected but when I'm receiving the compilation error not the error. How to remove the error.

Error: error TS2304: Cannot find name 'IScroll'.

glebmachine commented 8 years ago

You working with TypeScript. You should add Iscroll typings to your project Please, check this repo: https://github.com/types/npm-iscroll

psampath243 commented 8 years ago

I have added in typings.json and still receiving the compilation error.

{ "name": "iscroll", "main": "iscroll.d.ts", "homepage": "https://github.com/cubiq/iscroll", "ambientDependencies": { "angular": "registry:dt/angular#1.5.0+20160829152510", "angular-animate": "registry:dt/angular-animate#1.5.0+20160407085121", "angular-component-router": "registry:dt/angular-component-router#1.5.0+20160815132122", "angular-cookies": "github:DefinitelyTyped/DefinitelyTyped/angularjs/angular-cookies.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c", "angular-dynamic-locale": "registry:dt/angular-dynamic-locale#0.1.27+20160317120654", "angular-material": "registry:dt/angular-material#1.0.0-rc5.0+20160412154003", "angular-mocks": "github:DefinitelyTyped/DefinitelyTyped/angularjs/angular-mocks.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c", "angular-resource": "github:DefinitelyTyped/DefinitelyTyped/angularjs/angular-resource.d.ts#621f12c6602bcc569bc6ad3a67a0af3ba3832618", "angular-sanitize": "github:DefinitelyTyped/DefinitelyTyped/angularjs/angular-sanitize.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c", "angular-translate": "registry:dt/angular-translate#2.4.0+20160318095457", "at-angular": "file:node_modules/angular15-typescript/lib/at-angular.d.ts", "at-angular-resource": "file:node_modules/angular15-typescript/lib/at-angular-resource.d.ts", "d3": "registry:dt/d3#0.0.0+20160317120654", "es6-shim": "registry:dt/es6-shim#0.31.2+20160602141504", "github-electron": "registry:dt/github-electron#1.0.2+20160523035412", "jasmine": "registry:dt/jasmine#2.2.0+20160412134438", "jasmine-expect": "github:DefinitelyTyped/DefinitelyTyped/jasmine-expect/jasmine-expect.d.ts#50609913de56f251022dbd3c0cdbf34629dbe904", "jquery": "github:DefinitelyTyped/DefinitelyTyped/jquery/jquery.d.ts#470954c4f427e0805a2d633636a7c6aa7170def8", "lodash": "registry:global/lodash#4.0.0+20160701205107", "moment": "registry:dt/moment#2.8.0+20160316155526", "moment-node": "registry:dt/moment-node#2.11.1+20160417135035", "moment-timezone": "registry:dt/moment-timezone#0.2.5+20160329220348", "node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#20e1eb9616922d382d918cc5a21870a9dbe255f5", "nvd3": "registry:dt/nvd3#1.8.1+20160317120654", "restangular": "registry:dt/restangular#1.4.0+20160317120654", "ue-platform": "file:node_modules/ue-platform/lib/ue-platform.d.ts" }, "dependencies": { "iscroll": "registry:npm/iscroll#5.1.3+20160723033700" } }

Error: app\components\mobile-task-board\mobile-task-board-display\mobile-task-board-display.component.ts(141,25): error TS2304: Cannot find name 'IScroll'.

line 141 : this.myScroll = new IScroll('#wrapper', {probeType: 3, mouseWheel: true});

glebmachine commented 8 years ago

This is not iScroll issue itself, this about TypeScript static typing. Unfortunately I haven't strange expertise in this :(