blob: a069ff8b2e182ba8d3b5eeaea49e5ecbe7055ef4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
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 userId: string = '',
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);
|