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,10 +1,19 @@
import { NgModule } from '@angular/core'; import { NgModule } from "@angular/core";
import { Routes, RouterModule } from '@angular/router'; 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({ @NgModule({
imports: [RouterModule.forRoot(routes)], imports: [RouterModule.forRoot(routes)],
exports: [RouterModule] exports: [RouterModule]
}) })
export class AppRoutingModule { } export class AppRoutingModule {}

View File

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

View File

@ -5,13 +5,30 @@
<button <button
class="room-button" class="room-button"
[ngStyle]="{ [ngStyle]="{
color: device.lastStatus == 1 ? 'red' : 'green', color: 'black',
borderColor: device.lastStatus == 1 ? 'red' : 'green' backgroundColor:
device.lastStatus == 1
? 'red'
: device.lastStatus == 0
? 'green'
: 'yellow',
borderColor:
device.lastStatus == 1
? 'red'
: device.lastStatus == 0
? 'green'
: 'yellow'
}" }"
> >
{{ device.name }} {{ device.name }}
</button> </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> </div>
</div> </div>

View File

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