cstefanache / angular2-img-cropper

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

error TS7030: Not all code paths return a value #70

Closed lderks closed 7 years ago

lderks commented 7 years ago

Hi,

I'm getting this error:

node_modules/ng2-img-cropper/src/imageCropper.ts(841,12): error TS7030: Not all code paths return a value.

lderks commented 7 years ago

This is a TSLint semantic error. Could you please update that line of code so it will pass the TSlint validation?

lderks commented 7 years ago

To keep TSLint satisfied, change it to the code below.

public getDragTouchForID(id: any) {
        let currentDragTouch;
        for (let i = 0; i < this.currentDragTouches.length; i++) {
            if (id === this.currentDragTouches[i].id) {
                currentDragTouch = this.currentDragTouches[i];
            }
        }
        return currentDragTouch;
    }
cstefanache commented 7 years ago

fixed and will be released today with 0.7