routing added

This commit is contained in:
Dawid Kubicki 2019-01-13 16:56:55 +01:00
parent 17c0a90807
commit 20e01b61e0
4 changed files with 39 additions and 10 deletions

View File

@ -1,7 +1,16 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { NgModule } from "@angular/core";
import { Routes, RouterModule } from "@angular/router";
import { AppComponent } from "./app.component";
import { AdminComponent } from "./admin/admin.component";
import { StatusListComponent } from "./status-list/status-list.component";
const routes: Routes = [];
const routes: Routes = [
{ path: "", component: StatusListComponent },
{
path: "admin",
component: AdminComponent
}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],

View File

@ -1,6 +1,4 @@
<div class="container">
<router-outlet></router-outlet>
<app-header></app-header>
<!--<app-status-list> </app-status-list>-->
<app-admin></app-admin>
<router-outlet></router-outlet>
</div>

View File

@ -5,13 +5,30 @@
<button
class="room-button"
[ngStyle]="{
color: device.lastStatus == 1 ? 'red' : 'green',
borderColor: device.lastStatus == 1 ? 'red' : 'green'
color: 'black',
backgroundColor:
device.lastStatus == 1
? 'red'
: device.lastStatus == 0
? 'green'
: 'yellow',
borderColor:
device.lastStatus == 1
? 'red'
: device.lastStatus == 0
? 'green'
: 'yellow'
}"
>
{{ device.name }}
</button>
<b>{{ device.lastStatus == 1 ? "Zajęte" : "Wolne" }}</b>
<b>{{
device.lastStatus == 1
? "Zajęte"
: device.lastStatus == 0
? "Wolne"
: "Brak połączenia z czujnikiem"
}}</b>
</div>
</div>
</div>

View File

@ -195,3 +195,8 @@ table {
}
}
}
.example-button-row button,
.example-button-row a {
margin-right: 8px;
}