Basic edit-image-modal
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import { Component, OnInit,ViewChild,ElementRef } from '@angular/core';
|
||||
import {NgbModal} from "@ng-bootstrap/ng-bootstrap"
|
||||
import { ImageCroppedEvent,LoadedImage } from 'ngx-image-cropper';
|
||||
|
||||
@Component({
|
||||
selector: 'fm-edit-image-modal',
|
||||
templateUrl: './edit-image-modal.component.html',
|
||||
styleUrls: ['./edit-image-modal.component.scss']
|
||||
})
|
||||
export class EditImageModalComponent implements OnInit {
|
||||
|
||||
@ViewChild('upload_modal') modal:ElementRef;
|
||||
|
||||
constructor(private modalService: NgbModal) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
open(endpoint:string,aspectRatio:number) {
|
||||
this.aspectRatio= aspectRatio;
|
||||
this.modalService.open(this.modal,{ size: 'lg' });
|
||||
}
|
||||
|
||||
aspectRatio:number = 4/3;
|
||||
|
||||
imageChangedEvent: any = '';
|
||||
croppedImage: any = '';
|
||||
|
||||
fileChangeEvent(event: any): void {
|
||||
this.imageChangedEvent = event;
|
||||
}
|
||||
imageCropped(event: ImageCroppedEvent) {
|
||||
this.croppedImage = event.base64;
|
||||
}
|
||||
imageLoaded(image: LoadedImage) {
|
||||
}
|
||||
cropperReady() {
|
||||
// cropper ready
|
||||
}
|
||||
loadImageFailed() {
|
||||
// show message
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user