Skip to content

Commit

Permalink
Build && bump bower version
Browse files Browse the repository at this point in the history
  • Loading branch information
JetFault committed Sep 22, 2014
1 parent 1d32236 commit e323255
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-sails",
"version": "1.0.4",
"version": "1.0.5",
"authors": [
"Jan-Oliver Pantel <[email protected]>"
],
Expand Down
14 changes: 8 additions & 6 deletions dist/angular-sails.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ angular.module('ngSails').provider('$sails', function () {

this.url = undefined;
this.interceptors = [];
this.responseHandler = undefined;

this.$get = ['$q', '$timeout', function ($q, $timeout) {
var socket = io.connect(provider.url),
Expand All @@ -30,10 +31,11 @@ angular.module('ngSails').provider('$sails', function () {

return deferred;
},
resolveOrReject = function (deferred, data) {
// Make sure what is passed is an object that has a status and if that status is no 2xx, reject.
if (data && angular.isObject(data) && data.status && Math.floor(data.status / 100) !== 2) {
deferred.reject(data);
resolveOrReject = this.responseHandler || function (deferred, data, jwr) {
jwr.error = data.error;
// Make sure what is passed is an object that has a status that is a number and if that status is no 2xx, reject.
if (jwr && angular.isObject(jwr) && jwr.statusCode && !isNaN(jwr.statusCode) && Math.floor(jwr.statusCode / 100) !== 2) {
deferred.reject(jwr);
} else {
deferred.resolve(data);
}
Expand All @@ -52,8 +54,8 @@ angular.module('ngSails').provider('$sails', function () {
data = null;
}
deferred.promise.then(cb);
socket['legacy_' + methodName](url, data, function (result) {
resolveOrReject(deferred, result);
socket['legacy_' + methodName](url, data, function (result, jwr) {
resolveOrReject(deferred, result, jwr);
});
return deferred.promise;
};
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-sails.min.js

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

0 comments on commit e323255

Please sign in to comment.