From 39f9fcb303924c3f9dd8fce3f332d4bc4aa14a9d Mon Sep 17 00:00:00 2001 From: TAMARA JERINIC Date: Tue, 12 Apr 2022 19:01:22 +0200 Subject: Reorganizovani su item-dataset, item-model, my-datasets, my-models. Dodat je yes-no-dialog. 123 --- frontend/src/app/Shared.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'frontend/src/app/Shared.ts') 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 -- cgit v1.2.3