diff --git a/src/app/room/room.component.ts b/src/app/room/room.component.ts index 6b414efda75c20447892fce272639f38bb57e425..582301e28751e4d79e5ad799dd71ecf172a75175 100644 --- a/src/app/room/room.component.ts +++ b/src/app/room/room.component.ts @@ -16,11 +16,12 @@ export class RoomComponent implements OnInit { } ngOnInit() { - this.getRoom(); + this.route.params.subscribe(params => { + this.getRoom(params['roomId']); + }); } - getRoom(): void { - const roomId: string = this.route.snapshot.paramMap.get('roomId'); - this.roomService.getRoom(roomId).subscribe(room => this.room = room); + getRoom(id: string): void { + this.roomService.getRoom(id).subscribe(room => this.room = room); } }