You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
817 B
TypeScript
28 lines
817 B
TypeScript
2 years ago
|
import {Component, Inject} from "@angular/core";
|
||
|
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
|
||
|
import {BehaviorSubject} from "rxjs";
|
||
|
|
||
|
export type BusyDialogData = {
|
||
|
title: string,
|
||
|
message: BehaviorSubject<string>,
|
||
|
allowCancel?: boolean,
|
||
|
}
|
||
|
|
||
|
@Component({
|
||
|
selector: "app-busy-dialog",
|
||
|
templateUrl: "./busy-dialog.component.html",
|
||
|
styleUrls: ["./busy-dialog.component.scss"]
|
||
|
})
|
||
|
export class BusyDialogComponent {
|
||
|
|
||
|
public title: string;
|
||
|
public message?: string;
|
||
|
public allowCancel: boolean;
|
||
|
|
||
|
constructor(public dialogRef: MatDialogRef<BusyDialogComponent>, @Inject(MAT_DIALOG_DATA) data: BusyDialogData) {
|
||
|
this.title = data.title;
|
||
|
data.message.subscribe(m => this.message = m);
|
||
|
this.allowCancel = data.allowCancel ?? false;
|
||
|
}
|
||
|
}
|