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, 2022 in TypeSript by Logan
• 2,140 points
1,206 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, 2022 in TypeSript by Nina
• 3,060 points
48,365 views
0 votes
1 answer
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, 2022 in TypeSript by Nina
• 3,060 points
14,033 views
0 votes
1 answer

TypeScript TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'

If you want a key/value data structure ...READ MORE

answered Jun 7, 2022 in TypeSript by Nina
• 3,060 points
14,177 views
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, 2022 in TypeSript by Nina
• 3,060 points
2,204 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, 2022 in TypeSript by Nina
• 3,060 points
6,098 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,880 points
519 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, 2022 in TypeSript by Nina
• 3,060 points
1,559 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,880 points

edited Jan 21, 2020 by Niroj 805 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,880 points

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