import { Injectable } from '@angular/core';
import { Athlete } from './Athlete';
import { Http, Response } from "@angular/http";
import 'rxjs/add/operator/map';

@Injectable()
export class AthleteService {
  constructor(private http: Http){}

  getAthletes(){
    return this.http.get('api/athletes.json')
      .map((r: Response)=><Athlete[]>r.json().data);
  }
}