From 362ea422cc87240df71a48dc38091106bdead671 Mon Sep 17 00:00:00 2001 From: Thomas Lenz <Thomas.Lenz@mni.thm.de> Date: Fri, 9 Mar 2018 11:35:56 +0100 Subject: [PATCH] Remove logic from creator-room-component and use logic of room-list --- .../creator-home-screen.component.html | 9 +-------- .../creator-home-screen.component.ts | 10 ++++------ src/app/creator-room/creator-room.component.html | 2 +- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/app/creator-home-screen/creator-home-screen.component.html b/src/app/creator-home-screen/creator-home-screen.component.html index 0b5c3509d..401796f52 100644 --- a/src/app/creator-home-screen/creator-home-screen.component.html +++ b/src/app/creator-home-screen/creator-home-screen.component.html @@ -3,13 +3,6 @@ <button mat-raised-button color="primary" (click)="openCreateRoomDialog()">Create new room</button> </div> <div fxLayout="row" fxLayoutAlign="center"> -<!-- <app-room-list></app-room-list> --> - <mat-list> - <mat-list-item *ngFor="let room of rooms"> - <button mat-button routerLink="room/{{room.id}}"> - {{room.name}} - </button> - </mat-list-item> - </mat-list> + <app-room-list></app-room-list> </div> </div> diff --git a/src/app/creator-home-screen/creator-home-screen.component.ts b/src/app/creator-home-screen/creator-home-screen.component.ts index 874e0e586..c7dc503b2 100644 --- a/src/app/creator-home-screen/creator-home-screen.component.ts +++ b/src/app/creator-home-screen/creator-home-screen.component.ts @@ -2,22 +2,20 @@ import { Component, OnInit } from '@angular/core'; import { MatDialog } from '@angular/material'; import { RoomCreationComponent } from '../room-creation/room-creation.component'; import { RoomListComponent } from '../room-list/room-list.component'; -import { RoomService } from '../room.service'; +import { Room } from '../room'; @Component({ selector: 'app-creator-home-screen', templateUrl: './creator-home-screen.component.html', styleUrls: ['./creator-home-screen.component.scss'] }) -export class CreatorHomeScreenComponent extends RoomListComponent implements OnInit { +export class CreatorHomeScreenComponent implements OnInit { + creatorRooms: Room[]; - constructor(public dialog: MatDialog, - protected roomService: RoomService) { - super(roomService); + constructor(public dialog: MatDialog) { } ngOnInit() { - this.getRooms(); } openCreateRoomDialog(): void { diff --git a/src/app/creator-room/creator-room.component.html b/src/app/creator-room/creator-room.component.html index 8f1cb35a5..49b6ee188 100644 --- a/src/app/creator-room/creator-room.component.html +++ b/src/app/creator-room/creator-room.component.html @@ -1,4 +1,4 @@ -<div fxLayout="column" fxLayoutAlign="center" fxLayoutGap="20px" fxFill> +<div *ngIf="room" fxLayout="column" fxLayoutAlign="center" fxLayoutGap="20px" fxFill> <div fxLayout="row" fxLayoutAlign="center"> <div fxLayoutGap="20px"> <mat-list-item>Room: {{room.name}}</mat-list-item> -- GitLab