From 8ad9d56b07207970ce4261e8cb3d70f96cc60e36 Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Tue, 2 Mar 2021 14:48:49 +0100 Subject: [PATCH] Return modal reference for client side handling. --- .../edit-image-modal/edit-image-modal.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/common/src/fm/components/edit-image-modal/edit-image-modal.component.ts b/projects/common/src/fm/components/edit-image-modal/edit-image-modal.component.ts index a9ab44c..57c0ae8 100644 --- a/projects/common/src/fm/components/edit-image-modal/edit-image-modal.component.ts +++ b/projects/common/src/fm/components/edit-image-modal/edit-image-modal.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit,ViewChild,ElementRef,EventEmitter, Output } from '@angular/core'; import { HttpClient, HttpParams,HttpHeaders } from "@angular/common/http"; -import {NgbModal} from "@ng-bootstrap/ng-bootstrap" +import {NgbModal, NgbModalRef } from "@ng-bootstrap/ng-bootstrap" import { ImageCroppedEvent,LoadedImage } from 'ngx-image-cropper'; import {ImageService } from '../../services/image.service'; @@ -30,7 +30,7 @@ export class EditImageModalComponent implements OnInit { ngOnInit(): void { } - open(endpoint:string,aspectRatio:number,roundImage?:boolean,maxWidth?:number,saveImage?:boolean, imageType?:string) { + open(endpoint:string,aspectRatio:number,roundImage?:boolean,maxWidth?:number,saveImage?:boolean, imageType?:string): NgbModalRef { this.endpointUrl = endpoint; this.imageUrl = endpoint; this.aspectRatio= aspectRatio; @@ -38,7 +38,7 @@ export class EditImageModalComponent implements OnInit { this.maxWidth = maxWidth === undefined?this.maxWidth:maxWidth; this.imageType = imageType === undefined?this.imageType:imageType.substr(6); this.saveImage = saveImage === undefined?this.saveImage:saveImage; - this.modalService.open(this.modal,{ size: 'lg' }); + return this.modalService.open(this.modal,{ size: 'lg' }); } fileChangeEvent(event: any): void {