diff --git a/src/app/creator-room/creator-room.component.html b/src/app/creator-room/creator-room.component.html index cca53d81ebf3e7872b3976c6d7930f8f25592e4f..82ca7826df3cbcbf9e8bbac4a2138fe8e42a6365 100644 --- a/src/app/creator-room/creator-room.component.html +++ b/src/app/creator-room/creator-room.component.html @@ -14,6 +14,9 @@ <mat-list-item> <button mat-raised-button color="warn">Delete room</button> </mat-list-item> + <mat-list-item> + <button mat-raised-button color="primary" (click)="goBack()">Go back</button> + </mat-list-item> </div> </div> </div> diff --git a/src/app/creator-room/creator-room.component.ts b/src/app/creator-room/creator-room.component.ts index 61a7984b9639bf77f5de81c1963bba7d76c26dc0..0e702d8f33df661742c8835282d33d4f46ee0b50 100644 --- a/src/app/creator-room/creator-room.component.ts +++ b/src/app/creator-room/creator-room.component.ts @@ -3,6 +3,7 @@ import { RoomService } from '../room.service'; import { ActivatedRoute } from '@angular/router'; import { RoomComponent } from '../room/room.component'; import { Room } from '../room'; +import { Location } from '@angular/common'; @Component({ selector: 'app-creator-room', @@ -12,7 +13,8 @@ import { Room } from '../room'; export class CreatorRoomComponent extends RoomComponent implements OnInit { room: Room; constructor(protected roomService: RoomService, - protected route: ActivatedRoute) { + protected route: ActivatedRoute, + private location: Location) { super(roomService, route); } @@ -21,5 +23,8 @@ export class CreatorRoomComponent extends RoomComponent implements OnInit { this.getRoom(params['roomId']); }); } + goBack(): void { + this.location.back(); + } }