Skip to content
Snippets Groups Projects
Commit 88195bc7 authored by Thomas Lenz's avatar Thomas Lenz
Browse files

Add delete-notification

parent 9ccb3c51
No related merge requests found
......@@ -36,7 +36,7 @@
<mat-card-header><h3>Do you really want to delete this room?<br>This action can not be undone.</h3>
</mat-card-header>
<mat-card-content>
<button mat-raised-button color="warn" matTooltip="Delete selected room" (click)="delete(room)">
<button mat-raised-button color="warn" matTooltip="Delete selected room" (click)="deleteRoom(room)">
Delete room
</button>
<button mat-raised-button color="primary" matTooltip="Leave delete dialog" (click)="disableDeletion()">
......
......@@ -4,6 +4,7 @@ import { ActivatedRoute } from '@angular/router';
import { RoomComponent } from '../room/room.component';
import { Room } from '../room';
import { Location } from '@angular/common';
import { NotificationService } from '../notification.service';
@Component({
selector: 'app-creator-room',
......@@ -15,6 +16,7 @@ export class CreatorRoomComponent extends RoomComponent implements OnInit {
deleteDialog = false;
constructor(protected roomService: RoomService,
protected notification: NotificationService,
protected route: ActivatedRoute,
protected location: Location) {
super(roomService, route, location);
......@@ -38,4 +40,10 @@ export class CreatorRoomComponent extends RoomComponent implements OnInit {
this.deleteDialog = false;
}
deleteRoom(room: Room): void {
const msg = room.name + ' deleted';
this.notification.show(msg);
this.delete(room);
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment