You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.0 KiB

import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ApiService } from '../../services/api.service';
import { Season, SeasonWeek, SeasonStandingsEntry } from '../../models/season';
@Component({
selector: 'app-season-details',
templateUrl: './season-details.component.html',
styleUrls: ['./season-details.component.less']
})
export class SeasonDetailsComponent {
seasonInfo?: Season;
seasonStandings?: SeasonStandingsEntry[];
weeks?: SeasonWeek[];
constructor(
private route: ActivatedRoute,
private apiService: ApiService,
//private location: Location
)
{
}
ngOnInit(): void {
const id = Number(this.route.snapshot.paramMap.get('id'));
this.apiService.getSeasonDetails(id).subscribe(data => {
this.seasonInfo = (data as any).data.details;
this.weeks = (data as any).data.weeks;
this.seasonStandings = (data as any).data.standings;
console.log(this.seasonStandings);
console.log(this.weeks);
});
}
}