cstefanache / angular2-img-cropper

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

Return value issue on imageCropper.ts #145

Closed axtho closed 7 years ago

axtho commented 7 years ago

After updating to Angular 2.4.10 i am getting a node_modules/ng2-img-cropper/src/imageCropper.ts (937,38): Not all code paths return a value.)

This would be fixed with a simple

public getDragTouchForID(id:any):CropTouch | undefined {
        for (let i = 0; i < this.currentDragTouches.length; i++) {
            if (id === this.currentDragTouches[i].id) {
                return this.currentDragTouches[i];
            }
        }
       return undefined;
    }

Many packages are upgrading to the latest version now, with that of course TS (e.g. angular-cli, material2). Did you check the package against Angular 4 yet?

Thanks for the awesome work though ;)

cstefanache commented 7 years ago

Can you please open a pull request if it compiles on your side - would be great to have you as contributor if you already did the investigation

cstefanache commented 7 years ago

Fixed with PR - thanks