Skip to content

Commit

Permalink
new version (v0.2.4)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyTheTank committed Dec 23, 2016
1 parent 87bbf58 commit 8adefff
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 45 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"authors": [
"Jonathan Hornung <[email protected]>"
],
"version": "0.2.2",
"version": "0.2.4",
"description": "angular factory for the football-data.org rest api",
"main": "dist/angular-footballdata-api-factory.min.js",
"moduleType": [],
Expand Down
1 change: 1 addition & 0 deletions demo/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ app.controller('controller', ['$scope', 'footballdataFactory', function($scope,
console.info("getSeasons", _data);
});


footballdataFactory.getSeason({
id: '426',
apiKey: apiKey,
Expand Down
42 changes: 21 additions & 21 deletions dist/angular-footballdata-api-factory.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
@name: angular-footballdata-api-factory
@version: 0.2.2 (23-12-2016)
@version: 0.2.4 (23-12-2016)
@author: Jonathan Hornung
@url: https://github.com/JohnnyTheTank/angular-footballdata-api-factory#readme
@license: MIT
Expand Down Expand Up @@ -191,72 +191,72 @@ angular.module("jtt_footballdata", [])
switch (_type) {
case "getSeasons":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey', 'season',
'apiKey', 'season',
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/';
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'soccerseasons/';
break;

case "getSeason":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey',
'apiKey',
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/' + _params.id;
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'soccerseasons/' + _params.id;
break;

case "getTeam":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey'
'apiKey'
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'teams/' + _params.id;
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'teams/' + _params.id;
break;

case "getPlayersByTeam":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey'
'apiKey'
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'teams/' + _params.id + '/players';
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'teams/' + _params.id + '/players';
break;

case "getFixtures":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey', 'league', 'timeFrame'
'apiKey', 'league', 'timeFrame'
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'fixtures';
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'fixtures';
break;

case "getFixture":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey', 'head2head'
'apiKey', 'head2head'
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'fixtures/' + _params.id;
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'fixtures/' + _params.id;
break;

case "getTeamsBySeason":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey',
'apiKey',
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/' + _params.id + '/teams';
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'soccerseasons/' + _params.id + '/teams';
break;

case "getLeagueTableBySeason":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey', 'matchday'
'apiKey', 'matchday'
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/' + _params.id + '/leagueTable';
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'soccerseasons/' + _params.id + '/leagueTable';
break;

case "getFixturesBySeason":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey', 'matchday', 'timeFrame'
'apiKey', 'matchday', 'timeFrame'
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/' + _params.id + '/fixtures';
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'soccerseasons/' + _params.id + '/fixtures';
break;

case "getFixturesByTeam":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey', 'season', 'timeFrame', 'venue'
'apiKey', 'season', 'timeFrame', 'venue'
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'teams/' + _params.id + '/fixtures';
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'teams/' + _params.id + '/fixtures';
break;

}
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-footballdata-api-factory.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-footballdata-api-factory",
"version": "0.2.2",
"version": "0.2.4",
"description": "angularjs factory for footballdata jsonp rest api requests",
"main": "dist/angular-footballdata-api-factory.min.js",
"scripts": {
Expand Down
40 changes: 20 additions & 20 deletions src/angular-footballdata-api-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,72 +184,72 @@ angular.module("jtt_footballdata", [])
switch (_type) {
case "getSeasons":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey', 'season',
'apiKey', 'season',
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/';
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'soccerseasons/';
break;

case "getSeason":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey',
'apiKey',
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/' + _params.id;
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'soccerseasons/' + _params.id;
break;

case "getTeam":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey'
'apiKey'
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'teams/' + _params.id;
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'teams/' + _params.id;
break;

case "getPlayersByTeam":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey'
'apiKey'
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'teams/' + _params.id + '/players';
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'teams/' + _params.id + '/players';
break;

case "getFixtures":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey', 'league', 'timeFrame'
'apiKey', 'league', 'timeFrame'
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'fixtures';
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'fixtures';
break;

case "getFixture":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey', 'head2head'
'apiKey', 'head2head'
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'fixtures/' + _params.id;
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'fixtures/' + _params.id;
break;

case "getTeamsBySeason":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey',
'apiKey',
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/' + _params.id + '/teams';
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'soccerseasons/' + _params.id + '/teams';
break;

case "getLeagueTableBySeason":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey', 'matchday'
'apiKey', 'matchday'
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/' + _params.id + '/leagueTable';
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'soccerseasons/' + _params.id + '/leagueTable';
break;

case "getFixturesBySeason":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey', 'matchday', 'timeFrame'
'apiKey', 'matchday', 'timeFrame'
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'soccerseasons/' + _params.id + '/fixtures';
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'soccerseasons/' + _params.id + '/fixtures';
break;

case "getFixturesByTeam":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'protocol', 'apiKey', 'season', 'timeFrame', 'venue'
'apiKey', 'season', 'timeFrame', 'venue'
]);
footballdataSearchData.url = this.getApiBaseUrl(footballdataSearchData.object.protocol) + 'teams/' + _params.id + '/fixtures';
footballdataSearchData.url = this.getApiBaseUrl(_params.protocol) + 'teams/' + _params.id + '/fixtures';
break;

}
Expand Down

0 comments on commit 8adefff

Please sign in to comment.