angular-cropperjs icon indicating copy to clipboard operation
angular-cropperjs copied to clipboard

ERROR TypeError: Cannot read property 'scale' of undefined

Open jinghun1999 opened this issue 3 years ago • 1 comments

I used this component in ionic3. Another colleague's computer packed apk, no problem. The apk packaged on both of my computers is running with errors。 html file:

<angular-cropper [cropperOptions]="config"
                     (touchstart)="cropperTouchStart($event)"
                     [imageUrl]="imageUrl" #angularCropper></angular-cropper>

and typescript file:

...
@ViewChild('angularCropper') public angularCropper: AngularCropperjsComponent;
...
setTimeout(() => {
    console.log('this.angularCropper', this.angularCropper)
    this.angularCropper.cropper.scale(0.1, 0.1);
}, 500);

then show the error with "Cannot read property 'scale' of undefined"

jinghun1999 avatar Apr 20 '22 14:04 jinghun1999

my version is v0.1.5 and the cropperjs version is 1.5.2 I can't find any reason for this error as my colleague works well.

jinghun1999 avatar Apr 20 '22 14:04 jinghun1999