@@ -4,5 +4,5 @@
|
||||
</div>
|
||||
<mat-dialog-actions align="end">
|
||||
<button mat-raised-button mat-dialog-close>Cancel</button>
|
||||
<button mat-raised-button color="warn" [mat-dialog-close]="{ confirm: true }">Confirm</button>
|
||||
<button mat-raised-button color={{color}} [mat-dialog-close]="{ confirm: true }">Confirm</button>
|
||||
</mat-dialog-actions>
|
||||
|
||||
@@ -12,6 +12,7 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
})
|
||||
export class ConfirmationDialogComponent implements OnInit {
|
||||
|
||||
color: string;
|
||||
/**
|
||||
* @param {MatDialogRef} dialogRef Component reference to dialog.
|
||||
* @param {any} data Provides a deleteContext.
|
||||
@@ -20,6 +21,24 @@ export class ConfirmationDialogComponent implements OnInit {
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.setColor();
|
||||
}
|
||||
|
||||
setColor() {
|
||||
switch (this.data.type) {
|
||||
case 'Basic':
|
||||
this.color = 'primary';
|
||||
break;
|
||||
case 'Mild':
|
||||
this.color = 'accent';
|
||||
break;
|
||||
case 'Strong':
|
||||
this.color = 'warn';
|
||||
break;
|
||||
default:
|
||||
this.color = 'warn';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user