-
Notifications
You must be signed in to change notification settings - Fork 134
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
that.cropper.setImage is not a function. #128
Comments
is the cropper initialized at the moment when you want to execute setImage? |
maybe is the template reference variables that you don't set (#cropper). |
Hi guys, Thanks for your feedback. My code is exactly like this plunker, expect that I have it embedded in a modal. I do have #cropper reference and not sure what to put on AfterViewInit... Plunker: My code:
HTML:
|
After thinking the code a little more, I am getting the following error. caused by: self.parentView._ImageProfileUploaderComponent_26_3.context.openEdit is not a function. (In 'self.parentView._ImageProfileUploaderComponent_26_3.context.openEdit('contractor')', 'self.parentView._ImageProfileUploaderComponent_26_3.context.openEdit' is undefined) OpenEdit is actually my function to open the modal.
|
Is it possible to have either a plnkr or an error dump with the latest version of the cropper? thanks |
This seems to be an angular issue: angular/angular#5415 While the issue does provide a work-around, it doesn't seem to work for some reason. Is there any way the image can be passed via input? That would likely just cut around this issue without any further trouble. |
Hi there, |
Hi there, It may be useful for someone else, #cropper will not be defined by default since it is loaded inside ng-template (Modal).
upload
fileChangeListener($event, cropperComp: ImageCropperComponent) {
this.cropper = cropperComp; let image = new Image(); myReader.onloadend = function (loadEvent: any) { This worked for me. Refer: #166 |
I used this code web-dave/ngx-img-cropper#51. it may useful to others. |
Hi there!
Thanks for the feature, look awesome. I m having an issue while using it in a modal. I am getting the following error message.
that.cropper.setImage is not a function. (In 'that.cropper.setImage(image)', 'that.cropper.setImage' is undefined)
Thanks !
The text was updated successfully, but these errors were encountered: