diff options
author | Sonja Galovic <galovicsonja@gmail.com> | 2022-04-04 00:40:39 +0200 |
---|---|---|
committer | Sonja Galovic <galovicsonja@gmail.com> | 2022-04-04 00:40:39 +0200 |
commit | 5beed95078c5eec21113c9b5fede1c167e653a5e (patch) | |
tree | 4599a3e68536a8d9afd7dc45fec06a37ccd14788 /frontend/src/app/Shared.ts | |
parent | 94dcb65454e55caafa0a6e36e5766144cfb204c6 (diff) |
Odradjen prikaz svih obavestenja korisniku u okviru aplikacije. (umesto alerta ide mat-dialog)
Diffstat (limited to 'frontend/src/app/Shared.ts')
-rw-r--r-- | frontend/src/app/Shared.ts | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/frontend/src/app/Shared.ts b/frontend/src/app/Shared.ts index 31afb1a6..86e26687 100644 --- a/frontend/src/app/Shared.ts +++ b/frontend/src/app/Shared.ts @@ -1,9 +1,32 @@ +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'; + class Shared { constructor( public loggedIn: boolean, public username: string = '', - public photoId: string = '1' + public photoId: string = '1', + public dialog?: MatDialog + //public alertDialog?: ElementRef ) { } + + + openDialog(title: string, message: string): void { + console.log("USAO U OPEN DIALOG 1"); + + if (this.dialog) { + console.log("USAO U OPEN DIALOG 2"); + const dialogRef = this.dialog.open(AlertDialogComponent, { + //width: '250px', + data: { title: title, message: message } + }); + dialogRef.afterClosed().subscribe(res => { + //nesto + }); + } + } } export default new Shared(false);
\ No newline at end of file |