-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from JohnnyTheTank/plugin_json
added new plugin: json-string
- Loading branch information
Showing
15 changed files
with
124 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "apiNG", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"homepage": "https://github.com/JohnnyTheTank/apiNG", | ||
"authors": [ | ||
"Jonathan Hornung <[email protected]>" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
var app = angular.module('app', ['jtt_aping']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>apiNG Demo</title> | ||
|
||
<!-- apiNG dependencies --> | ||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script> | ||
|
||
<!-- apiNG --> | ||
<script src="../../dist/aping.js"></script> | ||
|
||
<!-- angular module --> | ||
<script src="app.js"></script> | ||
|
||
</head> | ||
<body ng-app="app"> | ||
|
||
<aping aping-json-string='{"gender":"male","name":{"title":"mr","first":"fernando","last":"soto"},"location":{"street":"5303 calle covadonga","city":"alicante","state":"cataluña","postcode":28020},"email":"[email protected]","login":{"username":"lazyduck489","password":"1616","salt":"vptikytR","md5":"68d978f4bc562fd270bf7297565af0ad","sha1":"451c9a970f114ea76e4760b7c5d68f5c11a4221c","sha256":"885489cc2ccf54d83f5bec2f2cbfc06c2282e2cda581e21f79febb45f990d62d"},"registered":1105370272,"dob":1319579754,"phone":"932-763-620","cell":"634-690-303","id":{"name":"DNI","value":"25588238-D"},"picture":{"large":"https://randomuser.me/api/portraits/men/92.jpg","medium":"https://randomuser.me/api/portraits/med/men/92.jpg","thumbnail":"https://randomuser.me/api/portraits/thumb/men/92.jpg"},"nat":"ES"}'> | ||
<pre>{{results | json}}</pre> | ||
</aping> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/** | ||
@name: aping | ||
@version: 1.3.2 (22-04-2016) | ||
@version: 1.3.3 (09-05-2016) | ||
@author: Jonathan Hornung <[email protected]> | ||
@url: https://github.com/JohnnyTheTank/apiNG | ||
@license: MIT | ||
|
@@ -10,6 +10,7 @@ angular.module('jtt_aping', [ | |
'jtt_aping_xml', | ||
'jtt_aping_ng_array', | ||
'jtt_aping_local_storage', | ||
'jtt_aping_json_string', | ||
]);;"use strict"; | ||
angular.module('jtt_aping') | ||
.config(['$provide', function ($provide) { | ||
|
@@ -369,19 +370,23 @@ angular.module('jtt_aping') | |
} | ||
var requests = []; | ||
var tempArray = this.replaceSingleQuotesAndParseJson(_string); | ||
angular.forEach(tempArray, function (value) { | ||
value.platform = _platform; | ||
if (_appSettings) { | ||
if (angular.isUndefined(value.items) && angular.isDefined(_appSettings.items)) { | ||
value.items = _appSettings.items; | ||
} | ||
if (angular.isUndefined(value.model) && angular.isDefined(_appSettings.model)) { | ||
value.model = _appSettings.model; | ||
if (tempArray.constructor === Array) { | ||
angular.forEach(tempArray, function (value) { | ||
value.platform = _platform; | ||
if (_appSettings) { | ||
if (angular.isUndefined(value.items) && angular.isDefined(_appSettings.items)) { | ||
value.items = _appSettings.items; | ||
} | ||
if (angular.isUndefined(value.model) && angular.isDefined(_appSettings.model)) { | ||
value.model = _appSettings.model; | ||
} | ||
} | ||
} | ||
var request = apingInputObjects.getNew("request", value); | ||
requests.push(request); | ||
}); | ||
var request = apingInputObjects.getNew("request", value); | ||
requests.push(request); | ||
}); | ||
} else { | ||
requests.push(tempArray); | ||
} | ||
return requests; | ||
}; | ||
|
||
|
@@ -1011,6 +1016,33 @@ angular.module("jtt_aping_jsonloader", []) | |
return jsonloaderFactory; | ||
}]);;"use strict"; | ||
|
||
angular.module("jtt_aping_json_string", []) | ||
.directive('apingJsonString', ['apingUtilityHelper', function (apingUtilityHelper) { | ||
return { | ||
require: '?aping', | ||
restrict: 'A', | ||
replace: 'false', | ||
link: function (scope, element, attrs, apingController) { | ||
|
||
var appSettings = apingController.getAppSettings(); | ||
var request = apingUtilityHelper.parseJsonFromAttributes(attrs.apingJsonString, "apingJsonString", appSettings); | ||
|
||
var resultArray = []; | ||
|
||
if (request) { | ||
if (request.constructor === Array) { | ||
resultArray = request; | ||
} else { | ||
resultArray.push(request); | ||
} | ||
if (resultArray.length > 0) { | ||
apingController.concatToResults(resultArray); | ||
} | ||
} | ||
} | ||
} | ||
}]);;"use strict"; | ||
|
||
angular.module("jtt_aping_ng_array", []) | ||
.directive('apingNgArray', ['apingUtilityHelper', function (apingUtilityHelper) { | ||
return { | ||
|
Oops, something went wrong.