breeze-client
Advanced tools
Comparing version 1.6.0 to 1.6.1
@@ -88,3 +88,5 @@ // Angular ajax adapter | ||
success: successFn, // adapter's success callback | ||
error: errorFn // adapter's error callback | ||
error: errorFn, // adapter's error callback | ||
responseSuccess: responseSuccessFn, // adapter's success callback (ng 1.6+) | ||
responseError: responseErrorFn // adapter's error callback (ng 1.6+) | ||
} | ||
@@ -100,8 +102,17 @@ | ||
if (requestInfo.config) { // exists unless requestInterceptor killed it. | ||
this.$http(requestInfo.config) | ||
.success(requestInfo.success) | ||
.error(requestInfo.error); | ||
var prom = this.$http(requestInfo.config); | ||
if (prom.success) { | ||
// response for ng < 1.6 | ||
prom.success(requestInfo.success).error(requestInfo.error); | ||
} else { | ||
// response for ng 1.6+ | ||
prom.then(requestInfo.responseSuccess).catch(requestInfo.responseError); | ||
} | ||
this.$rootScope && this.$rootScope.$digest(); | ||
} | ||
function responseSuccessFn(response) { | ||
return successFn(response.data, response.status, response.headers, response.config, response.statusText); | ||
} | ||
function successFn(data, status, headers, xconfig, statusText) { | ||
@@ -121,2 +132,6 @@ // HACK: because $http returns a server side null as a string containing "null" - this is WRONG. | ||
function responseErrorFn(response) { | ||
return errorFn(response.data, response.status, response.headers, response.config, response.statusText); | ||
} | ||
function errorFn(data, status, headers, xconfig, statusText) { | ||
@@ -123,0 +138,0 @@ // Timeout appears as an error with status===0 and no data. |
@@ -115,3 +115,3 @@ (function (factory) { | ||
// Add query params if .withParameters was used | ||
if (mappingContext.query.parameters) { | ||
if (!core.isEmpty(mappingContext.query.parameters)) { | ||
var paramString = toQueryString(mappingContext.query.parameters); | ||
@@ -124,3 +124,3 @@ var sep = url.indexOf("?") < 0 ? "?" : "&"; | ||
requestUri: url, | ||
headers: __extend({}, this.headers) | ||
headers: core.extend({}, this.headers) | ||
}, | ||
@@ -167,3 +167,3 @@ function (data, response) { | ||
var mheaders = __extend({}, this.headers); | ||
var mheaders = core.extend({}, this.headers); | ||
mheaders.Accept = 'application/*; odata.metadata=full'; | ||
@@ -234,3 +234,3 @@ | ||
OData.request({ | ||
headers: __extend({}, this.headers), | ||
headers: core.extend({}, this.headers), | ||
requestUri: url, | ||
@@ -237,0 +237,0 @@ method: "POST", |
{ | ||
"name": "breeze-client", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "Breeze Javascript client", | ||
@@ -5,0 +5,0 @@ "main": "breeze.debug", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1861757
36928