projects/web-mev/src/app/features/workspace-detail/components/metadata/dialogs/delete-set-dialog/delete-set-dialog.component.ts
Delete Observation Dialog Component
Modal dialog component which is used to delete a custom observation set
| changeDetection | ChangeDetectionStrategy.OnPush |
| selector | mev-delete-set-dialog |
| styleUrls | ./delete-set-dialog.component.scss |
| templateUrl | ./delete-set-dialog.component.html |
Properties |
Methods |
constructor(dialogRef: MatDialogRef
|
|||||||||
|
Parameters :
|
| confirmDelete |
confirmDelete()
|
|
Function is triggered when user clicks the Delete button
Returns :
void
|
| onNoClick |
onNoClick()
|
|
Function is triggered when user clicks the Cancel button
Returns :
void
|
| Public data |
Type : any
|
Decorators :
@Inject(MAT_DIALOG_DATA)
|
| Public dialogRef |
Type : MatDialogRef<DeleteSetDialogComponent>
|
import { Component, ChangeDetectionStrategy, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
/**
* Delete Observation Dialog Component
*
* Modal dialog component which is used to delete a custom observation set
*/
@Component({
selector: 'mev-delete-set-dialog',
templateUrl: './delete-set-dialog.component.html',
styleUrls: ['./delete-set-dialog.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class DeleteSetDialogComponent {
constructor(
public dialogRef: MatDialogRef<DeleteSetDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any
) {}
/**
* Function is triggered when user clicks the Cancel button
*
*/
onNoClick(): void {
this.dialogRef.close();
}
/**
* Function is triggered when user clicks the Delete button
*
*/
confirmDelete(): void {}
}
<div class="container">
<h3 mat-dialog-title>This custom observation/feature set will be deleted. Are you sure?</h3>
<div mat-dialog-content>
Set name: {{data.setId}}
<p></p>
</div>
<div mat-dialog-actions>
<button mat-button mat-raised-button [mat-dialog-close]="1" (click)="confirmDelete()" color="accent">Delete</button>
<button mat-button (click)="onNoClick()" tabindex="-1">Cancel</button>
</div>
</div>
./delete-set-dialog.component.scss
.container {
display: flex;
flex-direction: column;
min-width: 450px;
}
.container > * {
width: 100%;
}
.mat-dialog-content {
max-height: none;
overflow: visible;
}