File
Metadata
| selector |
mev-delete-ws-dialog |
| styleUrls |
./delete-ws-dialog.component.scss |
| templateUrl |
./delete-ws-dialog.component.html |
Methods
|
confirmDelete
|
confirmDelete()
|
|
|
|
|
|
Public
data
|
Type : any
|
Decorators :
@Inject(MAT_DIALOG_DATA)
|
|
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { Component, Inject } from '@angular/core';
import { WorkspaceService } from '@workspace-manager/services/workspace.service';
@Component({
selector: 'mev-delete-ws-dialog',
templateUrl: './delete-ws-dialog.component.html',
styleUrls: ['./delete-ws-dialog.component.scss']
})
export class DeleteWSDialogComponent {
constructor(
public dialogRef: MatDialogRef<DeleteWSDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,
public workspaceService: WorkspaceService
) {}
onNoClick(): void {
this.dialogRef.close();
}
confirmDelete(): void {
this.workspaceService.deleteWorkspace(this.data.id);
}
}
<div class="container">
<h3 mat-dialog-title>This workspace will be deleted. Are you sure?
(Note that your files will NOT be deleted)
</h3>
<div mat-dialog-content>
Id: {{data.id}}
<p></p>
Workspace name: {{data.workspace_name}}
<p></p>
</div>
<div mat-dialog-actions>
<button mat-button [mat-dialog-close]="1" (click)="confirmDelete()">Delete</button>
<button mat-button (click)="onNoClick()" tabindex="-1">Cancel</button>
</div>
</div>
.container {
display: flex;
flex-direction: column;
min-width: 450px;
}
.container > * {
width: 100%;
}
.mat-dialog-content {
max-height: none;
overflow: visible;
}
Legend
Html element with directive