From 0759e7b484f3e588da3487abad54bbc62b08f307 Mon Sep 17 00:00:00 2001 From: Joachim Date: Sat, 1 Sep 2018 12:13:14 +0200 Subject: [PATCH] getting there... --- src/app/app.component.html | 2 +- src/app/app.component.scss | 2 ++ src/app/app.module.ts | 16 +++++++----- src/app/content/poule/poule.component.html | 25 +++++++++++++++++++ .../{ => content}/poule/poule.component.scss | 0 .../poule/poule.component.spec.ts | 0 .../{ => content}/poule/poule.component.ts | 0 src/app/content/tier/tier.component.html | 4 +++ .../{ => content}/tier/tier.component.scss | 0 .../{ => content}/tier/tier.component.spec.ts | 0 src/app/{ => content}/tier/tier.component.ts | 0 src/app/poule/poule.component.html | 3 --- src/app/tier/tier.component.html | 3 --- src/app/topmenu/topmenu.component.html | 2 +- src/app/topmenu/topmenu.component.ts | 24 ++++++++++++++++-- 15 files changed, 65 insertions(+), 16 deletions(-) create mode 100644 src/app/content/poule/poule.component.html rename src/app/{ => content}/poule/poule.component.scss (100%) rename src/app/{ => content}/poule/poule.component.spec.ts (100%) rename src/app/{ => content}/poule/poule.component.ts (100%) create mode 100644 src/app/content/tier/tier.component.html rename src/app/{ => content}/tier/tier.component.scss (100%) rename src/app/{ => content}/tier/tier.component.spec.ts (100%) rename src/app/{ => content}/tier/tier.component.ts (100%) delete mode 100644 src/app/poule/poule.component.html delete mode 100644 src/app/tier/tier.component.html diff --git a/src/app/app.component.html b/src/app/app.component.html index cbba46f..75b2de7 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -4,7 +4,7 @@ -
+
diff --git a/src/app/app.component.scss b/src/app/app.component.scss index 8dfea3a..06a5c24 100644 --- a/src/app/app.component.scss +++ b/src/app/app.component.scss @@ -19,5 +19,7 @@ app-topmenu { #routerContent { grid-area: content; + overflow: auto !important; } + diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 4048ca9..d423079 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -3,15 +3,17 @@ import {NgModule} from '@angular/core'; import {AppComponent} from './app.component'; import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; -import {MatButtonModule, MatCheckboxModule} from '@angular/material'; +import {MatButtonModule, MatCardModule, MatCheckboxModule, MatTableModule} from '@angular/material'; import {RouterModule, Routes} from '@angular/router'; -import { TopmenuComponent } from './topmenu/topmenu.component'; -import { ReclamespinnerComponent } from './reclamespinner/reclamespinner.component'; -import { PouleComponent } from './poule/poule.component'; -import { TierComponent } from './tier/tier.component'; +import {TopmenuComponent} from './topmenu/topmenu.component'; +import {ReclamespinnerComponent} from './reclamespinner/reclamespinner.component'; +import {PouleComponent} from './content/poule/poule.component'; +import {TierComponent} from './content/tier/tier.component'; +import {HttpClient, HttpClientModule} from '@angular/common/http'; +import {Http} from '@angular/http'; const appRoutes: Routes = [ - { path: 'year/:year/tier/:tier', component: TierComponent }, + {path: 'championship/:idchampionship/tier/:tier', component: TierComponent}, // { path: 'hero/:id', component: HeroDetailComponent }, // { // path: 'heroes', @@ -36,8 +38,10 @@ const appRoutes: Routes = [ imports: [ BrowserModule, BrowserAnimationsModule, + HttpClientModule, MatButtonModule, MatCheckboxModule, + MatCardModule, RouterModule.forRoot( appRoutes // { enableTracing: true } // <-- debugging purposes only diff --git a/src/app/content/poule/poule.component.html b/src/app/content/poule/poule.component.html new file mode 100644 index 0000000..2874c8a --- /dev/null +++ b/src/app/content/poule/poule.component.html @@ -0,0 +1,25 @@ + + + + Poule 1 + + + + + + + + + + + + + + + + + + +
TeamRonde 1Ronde 2Ronde 3Gem. beste 2
Jos en Frank2 mins2 mins2 mins2 mins
+
+
diff --git a/src/app/poule/poule.component.scss b/src/app/content/poule/poule.component.scss similarity index 100% rename from src/app/poule/poule.component.scss rename to src/app/content/poule/poule.component.scss diff --git a/src/app/poule/poule.component.spec.ts b/src/app/content/poule/poule.component.spec.ts similarity index 100% rename from src/app/poule/poule.component.spec.ts rename to src/app/content/poule/poule.component.spec.ts diff --git a/src/app/poule/poule.component.ts b/src/app/content/poule/poule.component.ts similarity index 100% rename from src/app/poule/poule.component.ts rename to src/app/content/poule/poule.component.ts diff --git a/src/app/content/tier/tier.component.html b/src/app/content/tier/tier.component.html new file mode 100644 index 0000000..27eca84 --- /dev/null +++ b/src/app/content/tier/tier.component.html @@ -0,0 +1,4 @@ + + + + diff --git a/src/app/tier/tier.component.scss b/src/app/content/tier/tier.component.scss similarity index 100% rename from src/app/tier/tier.component.scss rename to src/app/content/tier/tier.component.scss diff --git a/src/app/tier/tier.component.spec.ts b/src/app/content/tier/tier.component.spec.ts similarity index 100% rename from src/app/tier/tier.component.spec.ts rename to src/app/content/tier/tier.component.spec.ts diff --git a/src/app/tier/tier.component.ts b/src/app/content/tier/tier.component.ts similarity index 100% rename from src/app/tier/tier.component.ts rename to src/app/content/tier/tier.component.ts diff --git a/src/app/poule/poule.component.html b/src/app/poule/poule.component.html deleted file mode 100644 index 2461d1e..0000000 --- a/src/app/poule/poule.component.html +++ /dev/null @@ -1,3 +0,0 @@ -

- poule works! -

diff --git a/src/app/tier/tier.component.html b/src/app/tier/tier.component.html deleted file mode 100644 index 58955ae..0000000 --- a/src/app/tier/tier.component.html +++ /dev/null @@ -1,3 +0,0 @@ -

- tier works! -

diff --git a/src/app/topmenu/topmenu.component.html b/src/app/topmenu/topmenu.component.html index 333b68c..c779440 100644 --- a/src/app/topmenu/topmenu.component.html +++ b/src/app/topmenu/topmenu.component.html @@ -1,6 +1,6 @@
- + diff --git a/src/app/topmenu/topmenu.component.ts b/src/app/topmenu/topmenu.component.ts index 8e43b6c..79edfef 100644 --- a/src/app/topmenu/topmenu.component.ts +++ b/src/app/topmenu/topmenu.component.ts @@ -1,4 +1,6 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; +import {ChampionshipService} from '../championship.service'; +import {ActivatedRoute} from '@angular/router'; @Component({ selector: 'app-topmenu', @@ -7,9 +9,27 @@ import { Component, OnInit } from '@angular/core'; }) export class TopmenuComponent implements OnInit { - constructor() { } + private idChampionship: number; + + constructor(private championshipService: ChampionshipService, + private route: ActivatedRoute) { + } ngOnInit() { + // listen to the path ... what's the championship we're at? + this.route.paramMap.subscribe(val => { + this.idChampionship = +val.get('idchampionship'); + }); + + } + + currentChampionship(): string { + const anies = this.championshipService.getChampionships().filter(val => val.idchampionship === this.idChampionship); + if (anies && anies[0]) { + return anies[0].name; + } else { + return '?'; + } } }