Added confirm dialog component to help with confirming actions

This commit is contained in:
Isaac Grynsztein
2020-07-05 22:12:07 -04:00
parent 2e7b1c2d53
commit 990b3d4037
4 changed files with 62 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import { Component, OnInit, Inject } from '@angular/core';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
@Component({
selector: 'app-confirm-dialog',
templateUrl: './confirm-dialog.component.html',
styleUrls: ['./confirm-dialog.component.scss']
})
export class ConfirmDialogComponent implements OnInit {
dialogTitle: 'Confirm';
dialogText: 'Would you like to confirm?';
submitText: 'Yes'
constructor(@Inject(MAT_DIALOG_DATA) public data: any) {
if (this.data.dialogTitle) { this.dialogTitle = this.data.dialogTitle };
if (this.data.dialogText) { this.dialogText = this.data.dialogText };
if (this.data.submitText) { this.submitText = this.data.submitText };
}
ngOnInit(): void {
}
}