Open robtown opened 5 years ago
This seems to work: import * as Cropper from 'cropperjs/dist/cropper';
then: if (this.angularCropper) { // Restart this.cropperConfig["aspectRatio"] = this.currentFeaturedItem.HeroTypeId == 163 ? 1.3333 : 2.25; this.angularCropper.cropper.destroy(); $('.img-preview').html('') let temp = this.angularCropper.imageElement; this.angularCropper.cropper = new Cropper(temp, this.cropperConfig); }
How would I reset the active cropper? I want to change aspect ration on the crop box.
This is how it would be done in JS:
cropper.destroy(); cropper = new Cropper(image, options);
.destroy() is there on the ViewChild object.
But how create the new Cropper?