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

Add "go back" button

parent 49272ef0
Branches
Tags
1 merge request!62Resolve "creator home screen - html template (room)" 2nd try
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
<mat-list-item> <mat-list-item>
<button mat-raised-button color="warn">Delete room</button> <button mat-raised-button color="warn">Delete room</button>
</mat-list-item> </mat-list-item>
<mat-list-item>
<button mat-raised-button color="primary" (click)="goBack()">Go back</button>
</mat-list-item>
</div> </div>
</div> </div>
</div> </div>
...@@ -3,6 +3,7 @@ import { RoomService } from '../room.service'; ...@@ -3,6 +3,7 @@ import { RoomService } from '../room.service';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { RoomComponent } from '../room/room.component'; import { RoomComponent } from '../room/room.component';
import { Room } from '../room'; import { Room } from '../room';
import { Location } from '@angular/common';
@Component({ @Component({
selector: 'app-creator-room', selector: 'app-creator-room',
...@@ -12,7 +13,8 @@ import { Room } from '../room'; ...@@ -12,7 +13,8 @@ import { Room } from '../room';
export class CreatorRoomComponent extends RoomComponent implements OnInit { export class CreatorRoomComponent extends RoomComponent implements OnInit {
room: Room; room: Room;
constructor(protected roomService: RoomService, constructor(protected roomService: RoomService,
protected route: ActivatedRoute) { protected route: ActivatedRoute,
private location: Location) {
super(roomService, route); super(roomService, route);
} }
...@@ -21,5 +23,8 @@ export class CreatorRoomComponent extends RoomComponent implements OnInit { ...@@ -21,5 +23,8 @@ export class CreatorRoomComponent extends RoomComponent implements OnInit {
this.getRoom(params['roomId']); this.getRoom(params['roomId']);
}); });
} }
goBack(): void {
this.location.back();
}
} }
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