Skip to content

Commit

Permalink
chore: bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyTheTank committed Mar 12, 2016
1 parent a440c48 commit bbcbb29
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apiNG",
"version": "1.3.0",
"version": "1.3.1",
"homepage": "https://github.com/JohnnyTheTank/apiNG",
"authors": [
"Jonathan Hornung <[email protected]>"
Expand Down
45 changes: 32 additions & 13 deletions dist/aping.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
@name: aping
@version: 1.3.0 (09-03-2016)
@version: 1.3.1 (12-03-2016)
@author: Jonathan Hornung <[email protected]>
@url: https://github.com/JohnnyTheTank/apiNG
@license: MIT
Expand All @@ -12,7 +12,6 @@ angular.module('jtt_aping', [
'jtt_aping_local_storage',
]);;"use strict";
angular.module('jtt_aping')

.config(['$provide', function ($provide) {
$provide.value("apingDefaultSettings", {
apingApiKeys: {}
Expand All @@ -36,8 +35,10 @@ angular.module('jtt_aping')
removeDoubles: '@',
mergeDoubles: '@',
idBy: '@',
resultProperty: '@',
valueName: '@'
resultProperty: '@', // legacy
resultName: '@',
valueName: '@',
protocol: '@'
},
link: function (scope, element, attrs, controller, transcludeFn) {

Expand Down Expand Up @@ -73,11 +74,15 @@ angular.module('jtt_aping')
},
controller: ['$scope', function ($scope) {

if (angular.isUndefined($scope.resultProperty)) {
$scope.resultProperty = "results";
if(angular.isUndefined($scope.resultName)) {
if (angular.isUndefined($scope.resultProperty)) {
$scope.resultName = "results";
} else {
$scope.resultName = $scope.resultProperty;
}
}

$scope[$scope.resultProperty] = [];
$scope[$scope.resultName] = [];
$scope.payload = $scope.payloadJson ? apingUtilityHelper.replaceSingleQuotesAndParseJson($scope.payloadJson) : {};

/**
Expand All @@ -95,6 +100,7 @@ angular.module('jtt_aping')
var mergeDoubles;
var valueName;
var idBy;
var protocol;


if (angular.isDefined($scope.valueName)) {
Expand Down Expand Up @@ -175,6 +181,14 @@ angular.module('jtt_aping')
idBy = undefined;
}

if (angular.isDefined($scope.protocol)) {
protocol = $scope.protocol;
} else if (angular.isDefined(apingDefaultSettings.protocol)) {
protocol = apingDefaultSettings.protocol;
} else {
protocol = undefined;
}

return {
model: $scope.model || apingDefaultSettings.model || "native",
getNativeData: getNativeData,
Expand All @@ -185,7 +199,8 @@ angular.module('jtt_aping')
removeDoubles: removeDoubles,
mergeDoubles: mergeDoubles,
idBy: idBy,
valueName: valueName
valueName: valueName,
protocol: protocol
};
};

Expand All @@ -195,11 +210,15 @@ angular.module('jtt_aping')
* @param _array
*/
this.concatToResults = function (_array) {
if (angular.isUndefined($scope.resultProperty)) {
$scope.resultProperty = "results";
if(angular.isUndefined($scope.resultName)) {
if (angular.isUndefined($scope.resultProperty)) {
$scope.resultName = "results";
} else {
$scope.resultName = $scope.resultProperty;
}
}

var tempArray = $scope[$scope.resultProperty].concat(_array);
var tempArray = $scope[$scope.resultName].concat(_array);

var appSettings = this.getAppSettings();

Expand Down Expand Up @@ -250,9 +269,9 @@ angular.module('jtt_aping')
apingResults[appSettings.valueName] = tempArray;
}

$scope[$scope.resultProperty] = tempArray;
$scope[$scope.resultName] = tempArray;

$scope.$broadcast('apiNG.resultMerged', {'resultProperty': $scope.resultProperty});
$scope.$broadcast('apiNG.resultMerged', {'resultName': $scope.resultName});
};
this.apply = function () {
$scope.$apply();
Expand Down
4 changes: 2 additions & 2 deletions dist/aping.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aping",
"version": "1.3.0",
"version": "1.3.1",
"description": "apiNG is an AngularJS directive that enables you to receive, aggregate, limit, order and display data from one or more sources. The complete setup is dead simple, just by adding data-attributes to your html",
"main": "dist/aping.min.js",
"scripts": {
Expand Down

0 comments on commit bbcbb29

Please sign in to comment.