Skip to content

Commit 5abd4e9

Browse files
author
guylabs
committed
Update dependencies
1 parent 72359f9 commit 5abd4e9

File tree

4 files changed

+26
-49
lines changed

4 files changed

+26
-49
lines changed

bower.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
"url": "https://github.com/guylabs/angular-spring-data-rest.git"
3434
},
3535
"dependencies": {
36-
"angular": "~1.3.0",
37-
"angular-resource": "~1.3.0"
36+
"angular": "~1.3.15",
37+
"angular-resource": "~1.3.15"
3838
},
3939
"devDependencies": {
40-
"angular-mocks": "~1.3.0"
40+
"angular-mocks": "~1.3.15"
4141
}
4242
}

dist/angular-spring-data-rest.js

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,7 @@ angular.module("spring-data-rest").provider("SpringDataRestAdapter", function ()
139139
var processData = function processDataFunction(promiseOrData, fetchLinkNames, recursive) {
140140

141141
// convert the given promise or data to a $q promise
142-
var promise = $injector.get("$q").when(promiseOrData);
143-
var deferred = $injector.get("$q").defer();
144-
145-
promise.then(function (data) {
142+
return $injector.get("$q").when(promiseOrData).then(function (data) {
146143

147144
/**
148145
* Wraps the Angular $resource method and adds the ability to retrieve the available resources. If no
@@ -221,14 +218,12 @@ angular.module("spring-data-rest").provider("SpringDataRestAdapter", function ()
221218

222219
// throw an exception if given data parameter is not of type object
223220
if (!angular.isObject(data) || data instanceof Array) {
224-
deferred.reject("Given data '" + data + "' is not of type object.");
225-
return;
221+
return $injector.get("$q").reject("Given data '" + data + "' is not of type object.");
226222
}
227223

228224
// throw an exception if given fetch links parameter is not of type array or string
229225
if (fetchLinkNames && !(fetchLinkNames instanceof Array || typeof fetchLinkNames === "string")) {
230-
deferred.reject("Given fetch links '" + fetchLinkNames + "' is not of type array or string.");
231-
return;
226+
return $injector.get("$q").reject("Given fetch links '" + fetchLinkNames + "' is not of type array or string.");
232227
}
233228

234229
var processedData = undefined;
@@ -307,26 +302,13 @@ angular.module("spring-data-rest").provider("SpringDataRestAdapter", function ()
307302
});
308303
}
309304

310-
$injector.get("$q").all(promisesArray).then(function () {
305+
return $injector.get("$q").all(promisesArray).then(function () {
311306

312307
// return the original data object if no processing is done
313-
deferred.resolve(processedData ? processedData : data);
314-
}, function (error) {
315-
deferred.reject(error);
316-
317-
// reject the error because we do not handle the error here
318-
return $injector.get("$q").reject(error);
308+
return processedData ? processedData : data;
319309
});
320-
}, function (error) {
321-
deferred.reject(error);
322-
323-
// reject the error because we do not handle the error here
324-
return $injector.get("$q").reject(error);
325310
});
326311

327-
// return the promise
328-
return deferred.promise;
329-
330312
/**
331313
* Gets the processed URL of the given resource name form the given data object.
332314
* @param {object} data the given data object

dist/angular-spring-data-rest.min.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@
9595
return c(f, a[e.linksKey][b].templated)
9696
}
9797

98-
var n = a.get("$q").when(i), o = a.get("$q").defer();
99-
return n.then(function (c) {
98+
return a.get("$q").when(i).then(function (c) {
10099
var d = function (a, b, d, h) {
101100
var i = this[e.linksKey], j = b;
102101
if (angular.isObject(a)) {
@@ -115,16 +114,16 @@
115114
} else l.push({name: b})
116115
}), l
117116
};
118-
if (c && c.data && (c = c.data), !angular.isObject(c) || c instanceof Array)return void o.reject("Given data '" + c + "' is not of type object.");
119-
if (k && !(k instanceof Array || "string" == typeof k))return void o.reject("Given fetch links '" + k + "' is not of type array or string.");
117+
if (c && c.data && (c = c.data), !angular.isObject(c) || c instanceof Array)return a.get("$q").reject("Given data '" + c + "' is not of type object.");
118+
if (k && !(k instanceof Array || "string" == typeof k))return a.get("$q").reject("Given fetch links '" + k + "' is not of type array or string.");
120119
var i = void 0, n = [];
121120
if (e.linksKey in c) {
122-
var p = {};
123-
p[e.resourcesKey] = d, i = angular.extend(angular.copy(c), p), void 0 != k && angular.forEach(c[e.linksKey], function (a, b) {
121+
var o = {};
122+
o[e.resourcesKey] = d, i = angular.extend(angular.copy(c), o), void 0 != k && angular.forEach(c[e.linksKey], function (a, b) {
124123
b != e.linksSelfLinkName && (k == e.fetchAllKey || "string" == typeof k && b == k || k instanceof Array && k.indexOf(b) >= 0) && n.push(h(m(c, b), b, i, k, l))
125124
})
126125
}
127-
e.embeddedKey in c && (i || (i = angular.copy(c)), i = b(i, e.embeddedKey, e.embeddedNewKey, e.embeddedNamedResources), angular.forEach(i[e.embeddedNewKey], function (a, b) {
126+
return e.embeddedKey in c && (i || (i = angular.copy(c)), i = b(i, e.embeddedKey, e.embeddedNewKey, e.embeddedNamedResources), angular.forEach(i[e.embeddedNewKey], function (a, b) {
128127
if (a instanceof Array && a.length > 0) {
129128
var c, d = [];
130129
angular.forEach(a, function (a, b) {
@@ -138,13 +137,9 @@
138137
i[e.embeddedNewKey][b] = a
139138
}))
140139
})), a.get("$q").all(n).then(function () {
141-
o.resolve(i ? i : c)
142-
}, function (b) {
143-
return o.reject(b), a.get("$q").reject(b)
140+
return i ? i : c
144141
})
145-
}, function (b) {
146-
return o.reject(b), a.get("$q").reject(b)
147-
}), o.promise
142+
})
148143
};
149144
return {process: i}
150145
}]

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@
2626
"bower": "~1.3.12",
2727
"coveralls": "^2.11.2",
2828
"grunt": "~0.4.5",
29-
"grunt-bower-install-simple": "~1.0.3",
30-
"grunt-contrib-concat": "~0.5.0",
31-
"grunt-contrib-uglify": "~0.6.0",
32-
"grunt-karma": "~0.9.0",
33-
"karma": "~0.12.23",
34-
"karma-chrome-launcher": "~0.1.4",
29+
"grunt-bower-install-simple": "~1.1.0",
30+
"grunt-contrib-concat": "~0.5.1",
31+
"grunt-contrib-uglify": "~0.8.0",
32+
"grunt-karma": "~0.10.1",
33+
"karma": "~0.12.31",
34+
"karma-chrome-launcher": "~0.1.7",
3535
"karma-coverage": "^0.2.7",
36-
"karma-firefox-launcher": "~0.1.3",
36+
"karma-firefox-launcher": "~0.1.4",
3737
"karma-jasmine": "~0.3.5",
38-
"karma-phantomjs-launcher": "~0.1.3",
39-
"load-grunt-tasks": "~1.0.0",
40-
"time-grunt": "~1.0.0"
38+
"karma-phantomjs-launcher": "~0.1.4",
39+
"load-grunt-tasks": "~3.1.0",
40+
"time-grunt": "~1.1.0"
4141
},
4242
"dependencies": {},
4343
"license": {

0 commit comments

Comments
 (0)