blob: 7be29cbf18bead1b27449f72c1a85cb27a54bc10 (
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
|
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 {
if (this.dialog) {
const dialogRef = this.dialog.open(AlertDialogComponent, {
width: '350px',
data: { title: title, message: message }
});
dialogRef.afterClosed().subscribe(res => {
//nesto
});
}
}
}
export default new Shared(false);
|