Skip to content
Snippets Groups Projects
Commit 141ad257 authored by David Noah Donges's avatar David Noah Donges
Browse files

Fix room detail component on param change

Now subscribing to route params and reloading data when params change as the component
didn't show the new data when navigating to another room detail page.
parent 6b8e9fd1
No related merge requests found
......@@ -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);
}
}
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