tiers now loading dynamically

This commit is contained in:
Joachim 2018-09-01 13:13:59 +02:00
parent d0262c2342
commit 153b710263
4 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1 @@
<router-outlet></router-outlet>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ChampionshipComponent } from './championship.component';
describe('ChampionshipComponent', () => {
let component: ChampionshipComponent;
let fixture: ComponentFixture<ChampionshipComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ChampionshipComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ChampionshipComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,22 @@
import { Component, OnInit } from '@angular/core';
import {ChampionshipService} from '../championship.service';
import {ActivatedRoute} from '@angular/router';
@Component({
selector: 'app-championship',
templateUrl: './championship.component.html',
styleUrls: ['./championship.component.scss']
})
export class ChampionshipComponent implements OnInit {
constructor(private route: ActivatedRoute, private championshipService: ChampionshipService) { }
ngOnInit() {
// mark the championservice to set the right championship
this.route.paramMap.subscribe(val => {
console.log(val);
this.championshipService.setChampionship(+val.get('idchampionship'));
});
}
}