diff options
Diffstat (limited to 'frontend/src/app/Shared.ts')
-rw-r--r-- | frontend/src/app/Shared.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/frontend/src/app/Shared.ts b/frontend/src/app/Shared.ts index 7be29cbf..59a2716d 100644 --- a/frontend/src/app/Shared.ts +++ b/frontend/src/app/Shared.ts @@ -2,6 +2,7 @@ import { ElementRef } from "@angular/core"; import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { AlertDialogComponent } from './_modals/alert-dialog/alert-dialog.component'; +import { YesNoDialogComponent } from './_modals/yes-no-dialog/yes-no-dialog.component'; class Shared { constructor( @@ -26,6 +27,18 @@ class Shared { }); } } + openYesNoDialog(title: string, message: string,yesFunction:Function): void { + + if (this.dialog) { + const dialogRef = this.dialog.open(YesNoDialogComponent, { + width: '350px', + data: { title: title, message: message,yesFunction} + }); + dialogRef.afterClosed().subscribe(res => { + //nesto + }); + } + } } export default new Shared(false);
\ No newline at end of file |