Closed ZeroDarkThirty closed 7 years ago
hi @ZeroDarkThirty this is a angular 1.x repo you can't use it in angular 2 or angular 4 project
Oh I see. Any idea on how to make football-data api calls using angular 2/4?
you can do the api calls directly
I haven't worked with external API in Angular before but I'm trying to figure it out. In my service I have this so far:
export class FootballService {
private _url: string = "http://api.football-data.org/v1/competitions/426/leagueTable";
constructor(private _http: Http) { }
getLeagueTable(){
return this._http.get(this._url)
.map((res: Response) => res.json());
}
}
Not sure if I'm on the right track or where the X-Auth-Token should go.
And in the component:
ngOnInit() {
this._footyService.getTeamName()
.subscribe(res => this.league = res); //league is an array
}
sorry I have no time to help you here
Hi,
I've done the first two steps of the installation (using npm) process, but I'm unsure as to how the third and fourth steps should work.
Do I have to add
jtt_footballdata
to theapp.module.ts
as a dependency? If so, then what should I use as theimport
statement?Also, do I have to include a path to the js file in my
.angular-cli.json
file in thescript
array?