image is not shown in image-cropper when insert image using ng2-file-upload ng2FileDrop #1146

Open
opened 2020-04-13 05:17:24 +00:00 by lmx-gowthamb · 1 comment
lmx-gowthamb commented 2020-04-13 05:17:24 +00:00 (Migrated from github.com)

`<div ng2FileDrop [ngClass]="{'another-file-over-class': hasAnotherDropZoneOver (onFileDrop)="dropped($event)" [uploader]="uploader">

<input type="file" ng2FileSelect [uploader]="uploader"
(change)="onFileSelected($event)" accept="image/png,image/gif,image/jpeg"
#selectfile />Choose File

public onFileSelected(event)
{
// its worked
this.imageChangedEvent = event;
}
dropped(event)
{
// its not worked
this.imageChangedEvent = event;
}`

`<div ng2FileDrop [ngClass]="{'another-file-over-class': hasAnotherDropZoneOver (onFileDrop)="dropped($event)" [uploader]="uploader"> <label class="custom-file-upload"> <input type="file" ng2FileSelect [uploader]="uploader" (change)="onFileSelected($event)" accept="image/png,image/gif,image/jpeg" #selectfile />Choose File </label> </div> <image-cropper [imageChangedEvent]="imageChangedEvent" [maintainAspectRatio]="true" [aspectRatio]="16/9" [onlyScaleDown]="true" [roundCropper]="false" format="png" outputType="base64" autoCrop="true" [containWithinAspectRatio]="containWithinAspectRatio" (imageCropped)="imageCropped($event)" (imageLoaded)="imageLoaded()" (cropperReady)="cropperReady()" (loadImageFailed)="loadImageFailed()" [alignImage]="'center'"> </image-cropper> public onFileSelected(event) { // its worked this.imageChangedEvent = event; } dropped(event) { // its not worked this.imageChangedEvent = event; }`
lmx-gowthamb commented 2020-04-14 05:36:14 +00:00 (Migrated from github.com)

yeah i done that. i pass the event like as {target:{files:event}} after get the file drop event. so it will works because you use the input like event.target.event[0] so i send like this format

yeah i done that. i pass the event like as {target:{files:event}} after get the file drop event. so it will works because you use the input like event.target.event[0] so i send like this format
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#1146