Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use this.angularCropper.cropper... in ng-modal #28

Open
Nelie-Taylor opened this issue Sep 17, 2018 · 3 comments
Open

Cannot use this.angularCropper.cropper... in ng-modal #28

Nelie-Taylor opened this issue Sep 17, 2018 · 3 comments

Comments

@Nelie-Taylor
Copy link

Hi. I use angular 6.2.2
Cropbox is work. But this.angularCropper.cropper.Sothing done not work.
image
image

Please help me. Thank you so much

@lijiejackylee
Copy link

same issue with me. I think the problem is that the imageload process is not completed, so the cropper is not instantiated yet, so the this.angularCropper.cropper.Somthing is undefined.

@valpas
Copy link

valpas commented Oct 3, 2019

same problem with angular 7.1, I need to use the setData function but cropper is not instantiated in my modal :/ there is an event when cropper is ready ?

@valpas
Copy link

valpas commented Oct 3, 2019

Finally I found a solution with Material Dialog

@ViewChild('angularCropper') public angularCropper: CropperComponent;

constructor(
        public dialogRef: MatDialogRef<DialogComponent>,
        @Inject(MAT_DIALOG_DATA) public data) {
    }

    ngOnInit() {
        this.dialogRef.afterOpened().subscribe(() => {
            console.log("after modal opened");
            console.log(this.angularCropper.cropper.getData());
        });
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants