import { Component } from '@angular/core';
import { AthleteService } from '../athlete.service';

@Component({
  selector: 'app-athlete-list',
  template: `
  <ol>
    <li *ngFor="let athlete of athletes">{{athlete.name}} ({{athlete.country}}): {{athlete.time}}</li>
  </ol>
  `,
})
export class AthleteListComponent {

  athletes: Array<any>;

  constructor(private athleteService: AthleteService){
    this.athletes=athleteService.getAthletes();
  }

}
