cstefanache / angular2-img-cropper

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

ng2-img-cropper not working with reactive form or model #260

Closed bhutiyaDilip closed 6 years ago

bhutiyaDilip commented 6 years ago

ng2-image-cropper is not working properly when I load image first time.when I upload same image second time than it will be loaded. crop crop1

bhutiyaDilip commented 6 years ago

i find the solutions for this issue. it's working well for me.

 myReader.onloadend = function (loadEvent:any) {
            image.src = loadEvent.target.result;
            let timeoutId = setTimeout(() => {
                that.cropper.setImage(image);
              }, 100);
        };
        myReader.readAsDataURL(file);

thanks.