Closed kolkov closed 7 years ago
check this plunker - might help you better: https://embed.plnkr.co/VFwGvAO6MhV06IDTLk5W/
Thanks! I try this in my code, but I see that cropper
is undefined (
Is this plnkr output? For me it works. But you can browse here: https://github.com/cstefanache/angular2-img-cropper/tree/master/runtime we also have a demo app
I see that in order to do this I need get access to cropper component :
@ViewChild('cropper', undefined) public cropper: ImageCropperComponent;
this.cropper.setImage(image);
but I can't and I do not understand why...
I find my mistake) My problem is from addition element around the cropper component.
<p>
<img-cropper [image]="data1" [settings]="cropperSettings1" (onCrop)="cropped($event)"></img-cropper>
<span class="result" >
<img [src]="data1.image" [width]="cropperSettings1.croppedWidth" [height]="cropperSettings1.croppedHeight">
</span>
</p>
when I removed tag <p>
my cropper object appeared.
Hi! I try to put image from image uploader. What data I must put to
data1
? HTMLImageElement or another type?<img-cropper [image]="data1" [settings]="cropperSettings1" (onCrop)="cropped($event)">
Or has another way to put image into the cropper?