Skip to content

Commit

Permalink
added new method and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyTheTank committed Jun 24, 2016
1 parent 173e6e6 commit 76d3da7
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 5 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 <jonathan.hornung@gmail.com>"
],
"version": "0.1.0",
"version": "0.2.0",
"description": "angular factory for the football-data.org rest api",
"main": "dist/angular-footballdata-api-factory.min.js",
"moduleType": [],
Expand Down
7 changes: 7 additions & 0 deletions demo/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ app.controller('controller', ['$scope', 'footballdataFactory', function($scope,
console.info("getSeasons", _data);
});

footballdataFactory.getSeason({
id: '424',
apiKey: apiKey,
}).then(function(_data){
console.info("getSeason", _data);
});

footballdataFactory.getFixtures({
apiKey: apiKey,
}).then(function(_data){
Expand Down
23 changes: 22 additions & 1 deletion 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.1.0 (21-06-2016)
@version: 0.2.0 (24-06-2016)
@author: Jonathan Hornung
@url: https://github.com/JohnnyTheTank/angular-footballdata-api-factory#readme
@license: MIT
Expand All @@ -26,6 +26,20 @@ angular.module("jtt_footballdata", [])
});
};

footballdataFactory.getSeason = function (_params) {

var searchData = footballdataSearchDataService.getNew("getSeason", _params);

return $http({
method: 'GET',
url: searchData.url,
params: searchData.object,
headers: {
'X-Auth-Token': _params.apiKey,
}
});
};

footballdataFactory.getTeam = function (_params) {

var searchData = footballdataSearchDataService.getNew("getTeam", _params);
Expand Down Expand Up @@ -171,6 +185,13 @@ angular.module("jtt_footballdata", [])
footballdataSearchData.url = this.getApiBaseUrl() + 'soccerseasons/';
break;

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

case "getTeam":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'apiKey'
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.1.0",
"version": "0.2.0",
"description": "angularjs factory for footballdata jsonp rest api requests",
"main": "dist/angular-footballdata-api-factory.min.js",
"scripts": {
Expand Down
21 changes: 21 additions & 0 deletions src/angular-footballdata-api-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ angular.module("jtt_footballdata", [])
});
};

footballdataFactory.getSeason = function (_params) {

var searchData = footballdataSearchDataService.getNew("getSeason", _params);

return $http({
method: 'GET',
url: searchData.url,
params: searchData.object,
headers: {
'X-Auth-Token': _params.apiKey,
}
});
};

footballdataFactory.getTeam = function (_params) {

var searchData = footballdataSearchDataService.getNew("getTeam", _params);
Expand Down Expand Up @@ -164,6 +178,13 @@ angular.module("jtt_footballdata", [])
footballdataSearchData.url = this.getApiBaseUrl() + 'soccerseasons/';
break;

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

case "getTeam":
footballdataSearchData = this.fillDataInObjectByList(footballdataSearchData, _params, [
'apiKey'
Expand Down

0 comments on commit 76d3da7

Please sign in to comment.