-
Notifications
You must be signed in to change notification settings - Fork 0
/
angular-adapter.min.js
3 lines (3 loc) · 1.18 KB
/
angular-adapter.min.js
1
2
3
/*! theon-angular-adapter - v0.1.0 - MIT License - https://github.com/theonjs/theon-angular-adapter */
angular.module("theon.adapter",[]).value("$theonAdapterTestAgent",null).factory("$theonAdapter",["$http","$theonResponseAdapter","$theonAdapterTestAgent",function(e,t,a){var s=e;function n(e,a,n){var r={url:e.url,method:e.method,auth:e.opts.auth,params:e.query,headers:e.headers,data:e.body,cache:e.agentOpts.cache,timeout:+e.opts.timeout||+e.agentOpts.timeout,withCredentials:e.agentOpts.withCredentials,xsrfHeaderName:e.agentOpts.xsrfHeaderName,xsrfCookieName:e.agentOpts.xsrfCookieName,transformRequest:e.agentOpts.transformRequest,transformResponse:e.agentOpts.transformResponse,paramSerializer:e.agentOpts.paramSerializer,responseType:e.agentOpts.responseType};s(r).then(function(e){n(null,t(a,e))},function(e){n(t(a,e))})}n.setAgent=function(e){s=e};return n}]).factory("$theonResponseAdapter",["$q",function(e){return function t(e,a){if(!a)return e;e.setOriginalResponse(a);e.setStatus(a.status);e.setStatusText(a.statusText);e.setHeaders(a.headers);if(a.data)e.setBody(a.data);return e}}]);
//# sourceMappingURL=http://cdn.rawgit.com/theonjs/theon-angular-adapter/0.1.0/angular-adapter.min.js.map