ngx-image-cropper imageloaded not passing any image data to typescript file event method

0 votes

I'm using ngx-image-cropper to load and crop images. According to the docs there is

(imageLoaded)="imageLoaded($event)"

but when I step into the typescript to debug the method 'imageLoaded()' image is undefined! It's not passing anything to the method.

In the library's code is see this

imageLoaded: EventEmitter<void>;

so it looks like the event doesn't pass anything, even though the docs say it does. Am I missing something here in terms of how I access the loaded image?

QUESTION - The docs don't show anything being passed in the html, should I pass in the '$event'?

  imageLoaded(image: HTMLImageElement) {
    // image is undefined
  }
<image-cropper
                [imageChangedEvent]="imageChangedEvent"
                [maintainAspectRatio]="true"
                [aspectRatio]="4/3"
                format="png"
                [transform]="transform"
                (imageCropped)="imageCropped($event)"
                (imageLoaded)="imageLoaded($event)"
                (loadImageFailed)="loadImageFailed()">
</image-cropper>
Jul 5 in TypeSript by Logan
• 2,140 points
38 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In TypeSript

0 votes
1 answer

What is "not assignable to parameter of type never" error in TypeScript?

All you have to do is define ...READ MORE

answered May 31 in TypeSript by Nina
• 3,020 points
840 views
0 votes
1 answer

TypeScript ES6: import module "File is not a module error"

We need the export, as a part of ...READ MORE

answered Jun 7 in TypeSript by Nina
• 3,020 points
539 views
0 votes
1 answer
0 votes
1 answer

How to read local csv file in JavaScript/TypeScript?

Here is how to use the readAsBinaryString() from the FileReader API ...READ MORE

answered Jun 9 in TypeSript by Nina
• 3,020 points
7 views
0 votes
1 answer

How to use document.getElementById() method in TypeScript?

Typescript will force you to check the ...READ MORE

answered Jun 15 in TypeSript by Nina
• 3,020 points
141 views
0 votes
1 answer

What is the best way to allow plugins for a PHP application?

Hello @kartik, I've used, it's an attempt to ...READ MORE

answered Apr 15, 2020 in PHP by Niroj
• 82,740 points
214 views
0 votes
1 answer

How to pass HTML to JPG/PNG? In Javascript/Typescript

You can use the package: https://www.npmjs.com/package/dom-to-image In your page: import ...READ MORE

answered Jun 22 in TypeSript by Nina
• 3,020 points
50 views
+1 vote
1 answer

What is the relationship between angularjs Scope with controller/view?

Let us consider the below block: <div ng-controller="emp"> ...READ MORE

answered Jan 20, 2020 in Web Development by Niroj
• 82,740 points

edited Jan 21, 2020 by Niroj 408 views
+1 vote
1 answer

What is css box module?

Hey, All the element present in html follows ...READ MORE

answered Jan 20, 2020 in Web Development by Niroj
• 82,740 points

edited Jan 21, 2020 by Niroj 476 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP