Skip to content

ERROR TypeError: Cannot read property 'scale' of undefined #68

Open
@jinghun1999

Description

@jinghun1999

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions