cstefanache / angular2-img-cropper

Angular 2 Image Cropper
MIT License
364 stars 135 forks source link

TypeScript compiler errors with "'this' implicitly has type 'any'" #98

Closed Tiliavir closed 7 years ago

Tiliavir commented 7 years ago

TypeScript 2 with tsconfig

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": true,
    "noImplicitReturns": true,
    "noImplicitThis": true,
    "noFallthroughCasesInSwitch": true,
    "skipLibCheck": true
  },
  "exclude": [
    "node_modules"
  ]
}

and system.js

            'angular2-notifications': {
                main: 'components.js',
                defaultExtension: 'js'
            }

fails with: node_modules/ng2-img-cropper/src/imageCropperComponent.ts(113,17): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. node_modules/ng2-img-cropper/src/imageCropperComponent.ts(114,31): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.

From my point of view it is wrong that TypeScript checks this in the first place (in particular with "skipLibCheck": true), but you might want to fix it anyways ...

NB: I think it was already fixed with https://github.com/cstefanache/angular2-img-cropper/pull/93/files

cstefanache commented 7 years ago

please check and close the issue if fixed

Tiliavir commented 7 years ago

Fixed! Works like a charm, thanks a lot for your effort!