@meanie/angular-api
Advanced tools
Comparing version 3.1.1 to 3.1.2
{ | ||
"name": "@meanie/angular-api", | ||
"description": "An Angular service for interaction with API's", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"homepage": "https://github.com/meanie/angular-api", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -485,2 +485,7 @@ /** | ||
//Already a model? | ||
if (this[key] instanceof Model) { | ||
return; | ||
} | ||
//Get model class and initiate | ||
@@ -487,0 +492,0 @@ if (angular.isArray(this[key])) { |
@@ -1,2 +0,2 @@ | ||
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};!function(t,n,e){"use strict";n.module("Api.Action.Service",["Url.Service"]).factory("$apiAction",["$q","$injector","$log","$url",function(t,e,r,i){function o(t){return t?e.has(t)?t:("$baseModel"!==t&&r.warn("Unknown model class/service:",t),null):null}function s(t,e){if(n.extend(this,t),this.url=i.concat(e.url,this.url||""),this.model=this.model||e.model||!1,this.method=this.method||"GET",this.enforceDataFormat=e.enforceDataFormat||!1,e.config)for(var r in e.config)e.config.hasOwnProperty(r)&&(this[r]=e.config[r]);"undefined"==typeof this.params&&(this.params=e.params),this.params=this.params||{},this.model=o(this.model)}return s.prototype.hasBody=function(){return/^(POST|PUT|PATCH)$/i.test(this.method)},s.prototype.expectsArray=function(){return Boolean(this.isArray)},s.prototype.expectsModel=function(){return this.model&&Boolean(this.isModel)},s.prototype.convertToModel=function(t){var r=this;if(n.isArray(t))return t.map(function(t){return r.convertToModel(t)});if(!t||null===t)return null;var i=e.get(this.model);return new i(t)},s.prototype.parseData=function(t){var e=this.expectsArray(),i=this.expectsModel(),o=n.isArray(t);return o!==e&&(r.warn("Expected",e?"array":"object","as response, got",o?"array":"undefined"==typeof t?"undefined":_typeof(t),"for",this.method,this.url),this.enforceDataFormat&&(t=e?[]:{})),e&&!t?[]:i?this.convertToModel(t):t},s.prototype.successInterceptor=function(t){var n=t.data,e=this.dataKey;if(e){if("undefined"==typeof n[e])throw new Error("Unknown data key: "+e);return n[e]=this.parseData(n[e]),n}return this.parseData(n)},s.prototype.errorInterceptor=function(n){return t.reject(n)},function(t,n){return new s(t,n)}}])}(window,window.angular),function(t,n,e){"use strict";n.module("Api.Service",["Api.Endpoint.Service"]).provider("$api",function(){this.defaults={verbose:!1,enforceDataFormat:!1,baseUrl:"/",actions:{query:{method:"GET",isArray:!0,isModel:!0},get:{method:"GET",isModel:!0},create:{method:"POST"},update:{method:"PUT"},"delete":{method:"DELETE"}},params:{id:"@id"},model:"",config:{},stripTrailingSlashes:!0},this.endpoints={},this.setVerbose=function(t){return this.defaults.verbose=!!t,this},this.setBaseUrl=function(t){return this.defaults.baseUrl=t.replace(/:([0-9]+)/,"\\:$1"),this},this.setEnforceDataFormat=function(t){return this.defaults.enforceDataFormat=!!t,this},this.setDefaultActions=function(t){return this.defaults.actions=t||{},this},this.setDefaultParams=function(t){return this.defaults.params=t||{},this},this.setDefaultModel=function(t){return this.defaults.model=t||!1,this},this.setConfig=function(t,n){return this.defaults.config[t]=n,this},this.stripTrailingSlashes=function(t){return this.defaults.stripTrailingSlashes=!!t,this},this.registerEndpoint=function(t,n){return t&&(this.endpoints[t]=n||{}),this},this.$get=["$log","$apiEndpoint",function(t,e){var r=this,i=function(t){return this[t]};return n.forEach(this.endpoints,function(o,s){i[s]&&t.warn("API endpoint",s,"is being overwritten."),o=n.extend({},r.defaults,o),o.verbose&&t.info("API endpoint",s+":",o),i[s]=e(s,o)}),i}]})}(window,window.angular);var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};!function(t,n,e){"use strict";n.module("BaseModel.Service",[]).factory("$baseModel",["$window","$log","$injector",function(t,e,r){function i(t){var n=/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).*/;if(t.match(n)){var e=a(t,a.ISO_8601,!0);if(e.isValid())return e}return null}function o(t,e){if(n.isArray(t[e])){var r=function(){var n=t[e];return{v:n.map(function(t,e){return o(n,e)})}}();if("object"===("undefined"==typeof r?"undefined":_typeof(r)))return r.v}return t[e]&&n.isFunction(t[e].clone)?t[e].clone():n.copy(t[e])}function s(t,n){var e=n;Object.defineProperty(this,"$parent",{enumerable:!1,get:function(){return e},set:function(t){e=t}}),this.fromJSON(t)}var a=void 0;return r.has("moment")?a=r.get("moment"):"undefined"!=typeof t.moment&&(a=t.moment),s.prototype.convertToModel=function(t,i,o){var a=this;if("boolean"==typeof i&&(o=i,i=null),"undefined"==typeof this[t]&&(o?this[t]=[]:this[t]=null),i&&this[t]){if("string"==typeof i){if(!r.has(i))return e.warn("Unknown model",i,"specified for sub model conversion");i=r.get(i)}n.isArray(this[t])?this[t]=this[t].map(function(t){return new i(t,a)}):n.isString(this[t])&&s.isId(this[t])?this[t]=new i({id:this[t]},this):this[t]=new i(this[t],this)}},s.prototype.fromJSON=function(t){var e=this;return n.isObject(t)&&n.forEach(t,function(t,n){e[n]=s.valueFromJSON(t)},this),this},s.prototype.toJSON=function(t){var e={};return t&&n.isObject(t)&&n.forEach(t,function(t,n){e[n]=s.valueToJSON(t)}),n.forEach(this,function(t,n){e.hasOwnProperty(n)||(e[n]=s.valueToJSON(t))}),e},s.prototype.extract=function(t){var e=this;if("string"==typeof t)return o(this,t);var r={};return n.isArray(t)&&t.length?n.forEach(t,function(t){r[t]=o(e,t)}):n.forEach(this,function(t,n){"$$"!==n.substr(0,2)&&(r[n]=o(e,n))}),r},s.prototype.merge=function(t){var e=this;return t&&n.isObject(t)&&n.forEach(t,function(n,r){e[r]=o(t,r)}),this},s.prototype.clear=function(){for(var t in this)this.hasOwnProperty(t)&&delete this[t];return this},s.prototype.clone=function(t){var n=this.constructor,e=new n(this.extract(),this.$parent);return t&&delete e.id,e},s.prototype.isSame=function(t){return!!t&&(n.isObject(t)?!!t.id&&(this.id&&t.id&&this.id===t.id):this.id===t)},s.prototype.copyProperty=function(t,e){this[e]&&n.isFunction(this[e].clone)?t[e]=this[e].clone():t[e]=n.copy(this[e])},s.prototype.setParent=function(t){this.$parent=t},s.valueFromJSON=function(t){if(n.isArray(t))return t.map(s.valueFromJSON);if(a&&n.isString(t)){var e=i(t);return e||t}if(t&&n.isObject(t)){if(t._isAMomentObject)return t.clone();var r={};for(var o in t)t.hasOwnProperty(o)&&(r[o]=s.valueFromJSON(t[o]));return r}return t},s.valueToJSON=function(t){if(n.isArray(t))return t.map(s.valueToJSON);if(t&&n.isObject(t)){if(n.isFunction(t.toJSON))return t.toJSON();var e={};for(var r in t)t.hasOwnProperty(r)&&"$$"!==r.substr(0,2)&&(e[r]=s.valueToJSON(t[r]));return e}return t},s.onlyId=function(t){return n.isArray(t)?t.map(s.onlyId):t&&"object"===("undefined"==typeof t?"undefined":_typeof(t))&&t.id?t.id:t},s.strip=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return n.isArray(t)?t.map(function(t){return s.strip.apply(s,[t].concat(r))}):t&&"object"===("undefined"==typeof t?"undefined":_typeof(t))?(n.forEach(t,function(n,e){r.includes(e)||delete t[e]}),t):t},s.stripIds=function(t){return n.isArray(t)?t.map(function(t){return s.stripIds(t)}):t&&"object"===("undefined"==typeof t?"undefined":_typeof(t))?("undefined"!=typeof t.id&&delete t.id,n.forEach(t,function(t){t&&"object"===("undefined"==typeof t?"undefined":_typeof(t))&&s.stripIds(t)}),t):t},s.isId=function(t){return t.match(/^[a-f\d]{24}$/i)},s}])}(window,window.angular),function(t,n,e){"use strict";n.module("Api.Endpoint.Service",["Api.Action.Service","Api.Request.Service","Url.Service"]).factory("$apiEndpoint",["$url","$apiAction","$apiRequest",function(t,e,r){function i(i,o){var s=this;o.actions=o.actions||{},o.url=t.concat(o.baseUrl,o.url||t.concat(i,":id")),this.$config=o,this.$actions={},n.forEach(o.actions,function(t,i){s.$actions[i]=e(t||{},o),s[i]=n.bind(s,r,s.$actions[i])})}return function(t,n){return new i(t,n)}}])}(window,window.angular),function(t,n,e){"use strict";n.module("Api.Request.Service",["Url.Service"]).factory("$apiRequest",["$http","$url",function(t,r){function i(t){return t&&"hasOwnProperty"!==t&&/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/.test("."+t)}function o(t,n){if(!i(n))throw new Error("Invalid dotted path:"+n);for(var r=n.split("."),o=0;o<r.length&&t!==e;o++){var s=r[o];t=null!==t?t[s]:e}return t}function s(t,e,r){var i={};return n.forEach(t||{},function(t,e){n.isFunction(t)&&(t=t()),n.isString(t)&&"@"===t.charAt(0)&&(t=o(r,t.substr(1))),i[e]=t}),n.extend(i,e||{})}function a(t){var e={};return n.forEach(t.split(/\W/),function(n){if("hasOwnProperty"===n)throw new Error("Invalid parameter name: hasOwnProperty");n&&!/^\\d+$/.test(n)&&new RegExp("(^|[^\\\\]):"+n+"(\\W|$)").test(t)&&(e[n]=!0)}),e}function u(t,n){return n&&(t=t.replace(/\/+$/,"")||"/"),t.replace(/\/\.(?=\w+($|\?))/,".").replace(/\/\\\./,"/.")}function c(t,e,i,o){return t=t.replace(/\\:/g,":"),n.forEach(i,function(i,o){var s=e.hasOwnProperty(o)?e[o]:null,a=void 0;n.isDefined(s)&&null!==s?!function(){var n=r.encodeUriSegment(s);a=new RegExp(":"+o+"(\\W|$)","g"),t=t.replace(a,function(t,e){return n+e})}():(a=new RegExp("(/?):"+o+"(\\W|$)","g"),t=t.replace(a,function(t,n,e){return"/"===e.charAt(0)?e:n+e}))}),u(t,o)}function f(t,e,r,i){var o={},u=["params","model","isArray","isModel","successInterceptor","errorInterceptor","stripTrailingSlashes"];if(n.forEach(t,function(t,e){u.indexOf(e)===-1&&(o[e]=n.copy(t))}),i&&n.isObject(i)&&n.forEach(i,function(t,e){o[e]=n.copy(t)}),t.hasBody()&&r&&n.isObject(r)&&(n.isFunction(r.toJSON)?o.data=r.toJSON():n.isArray(r)?o.data=r:o.data=n.extend({},r)),e=n.copy(e),e&&n.isObject(e))for(var f in e)e.hasOwnProperty(f)&&n.isObject(e[f])&&n.isFunction(e[f].toJSON)&&(e[f]=e[f].toJSON());e=s(t.params,e,r);var p=a(o.url);return o.url=c(t.url,e,p,t.stripTrailingSlashes),n.forEach(e,function(t,n){p[n]||(o.params=o.params||{},o.params[n]=t)}),o}return function(n,e,r,i){n.hasBody()&&e&&!r&&(r=e,e=null);var o=f(n,e,r,i);return t(o).then(function(t){return n.successInterceptor(t)})["catch"](function(t){return n.errorInterceptor(t)})}}])}(window,window.angular); | ||
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};!function(t,n,e){"use strict";n.module("Api.Action.Service",["Url.Service"]).factory("$apiAction",["$q","$injector","$log","$url",function(t,e,r,i){function o(t){return t?e.has(t)?t:("$baseModel"!==t&&r.warn("Unknown model class/service:",t),null):null}function s(t,e){if(n.extend(this,t),this.url=i.concat(e.url,this.url||""),this.model=this.model||e.model||!1,this.method=this.method||"GET",this.enforceDataFormat=e.enforceDataFormat||!1,e.config)for(var r in e.config)e.config.hasOwnProperty(r)&&(this[r]=e.config[r]);"undefined"==typeof this.params&&(this.params=e.params),this.params=this.params||{},this.model=o(this.model)}return s.prototype.hasBody=function(){return/^(POST|PUT|PATCH)$/i.test(this.method)},s.prototype.expectsArray=function(){return Boolean(this.isArray)},s.prototype.expectsModel=function(){return this.model&&Boolean(this.isModel)},s.prototype.convertToModel=function(t){var r=this;if(n.isArray(t))return t.map(function(t){return r.convertToModel(t)});if(!t||null===t)return null;var i=e.get(this.model);return new i(t)},s.prototype.parseData=function(t){var e=this.expectsArray(),i=this.expectsModel(),o=n.isArray(t);return o!==e&&(r.warn("Expected",e?"array":"object","as response, got",o?"array":"undefined"==typeof t?"undefined":_typeof(t),"for",this.method,this.url),this.enforceDataFormat&&(t=e?[]:{})),e&&!t?[]:i?this.convertToModel(t):t},s.prototype.successInterceptor=function(t){var n=t.data,e=this.dataKey;if(e){if("undefined"==typeof n[e])throw new Error("Unknown data key: "+e);return n[e]=this.parseData(n[e]),n}return this.parseData(n)},s.prototype.errorInterceptor=function(n){return t.reject(n)},function(t,n){return new s(t,n)}}])}(window,window.angular),function(t,n,e){"use strict";n.module("Api.Service",["Api.Endpoint.Service"]).provider("$api",function(){this.defaults={verbose:!1,enforceDataFormat:!1,baseUrl:"/",actions:{query:{method:"GET",isArray:!0,isModel:!0},get:{method:"GET",isModel:!0},create:{method:"POST"},update:{method:"PUT"},"delete":{method:"DELETE"}},params:{id:"@id"},model:"",config:{},stripTrailingSlashes:!0},this.endpoints={},this.setVerbose=function(t){return this.defaults.verbose=!!t,this},this.setBaseUrl=function(t){return this.defaults.baseUrl=t.replace(/:([0-9]+)/,"\\:$1"),this},this.setEnforceDataFormat=function(t){return this.defaults.enforceDataFormat=!!t,this},this.setDefaultActions=function(t){return this.defaults.actions=t||{},this},this.setDefaultParams=function(t){return this.defaults.params=t||{},this},this.setDefaultModel=function(t){return this.defaults.model=t||!1,this},this.setConfig=function(t,n){return this.defaults.config[t]=n,this},this.stripTrailingSlashes=function(t){return this.defaults.stripTrailingSlashes=!!t,this},this.registerEndpoint=function(t,n){return t&&(this.endpoints[t]=n||{}),this},this.$get=["$log","$apiEndpoint",function(t,e){var r=this,i=function(t){return this[t]};return n.forEach(this.endpoints,function(o,s){i[s]&&t.warn("API endpoint",s,"is being overwritten."),o=n.extend({},r.defaults,o),o.verbose&&t.info("API endpoint",s+":",o),i[s]=e(s,o)}),i}]})}(window,window.angular);var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};!function(t,n,e){"use strict";n.module("BaseModel.Service",[]).factory("$baseModel",["$window","$log","$injector",function(t,e,r){function i(t){var n=/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).*/;if(t.match(n)){var e=a(t,a.ISO_8601,!0);if(e.isValid())return e}return null}function o(t,e){if(n.isArray(t[e])){var r=function(){var n=t[e];return{v:n.map(function(t,e){return o(n,e)})}}();if("object"===("undefined"==typeof r?"undefined":_typeof(r)))return r.v}return t[e]&&n.isFunction(t[e].clone)?t[e].clone():n.copy(t[e])}function s(t,n){var e=n;Object.defineProperty(this,"$parent",{enumerable:!1,get:function(){return e},set:function(t){e=t}}),this.fromJSON(t)}var a=void 0;return r.has("moment")?a=r.get("moment"):"undefined"!=typeof t.moment&&(a=t.moment),s.prototype.convertToModel=function(t,i,o){var a=this;if("boolean"==typeof i&&(o=i,i=null),"undefined"==typeof this[t]&&(o?this[t]=[]:this[t]=null),i&&this[t]){if("string"==typeof i){if(!r.has(i))return e.warn("Unknown model",i,"specified for sub model conversion");i=r.get(i)}this[t]instanceof i||(n.isArray(this[t])?this[t]=this[t].map(function(t){return new i(t,a)}):n.isString(this[t])&&s.isId(this[t])?this[t]=new i({id:this[t]},this):this[t]=new i(this[t],this))}},s.prototype.fromJSON=function(t){var e=this;return n.isObject(t)&&n.forEach(t,function(t,n){e[n]=s.valueFromJSON(t)},this),this},s.prototype.toJSON=function(t){var e={};return t&&n.isObject(t)&&n.forEach(t,function(t,n){e[n]=s.valueToJSON(t)}),n.forEach(this,function(t,n){e.hasOwnProperty(n)||(e[n]=s.valueToJSON(t))}),e},s.prototype.extract=function(t){var e=this;if("string"==typeof t)return o(this,t);var r={};return n.isArray(t)&&t.length?n.forEach(t,function(t){r[t]=o(e,t)}):n.forEach(this,function(t,n){"$$"!==n.substr(0,2)&&(r[n]=o(e,n))}),r},s.prototype.merge=function(t){var e=this;return t&&n.isObject(t)&&n.forEach(t,function(n,r){e[r]=o(t,r)}),this},s.prototype.clear=function(){for(var t in this)this.hasOwnProperty(t)&&delete this[t];return this},s.prototype.clone=function(t){var n=this.constructor,e=new n(this.extract(),this.$parent);return t&&delete e.id,e},s.prototype.isSame=function(t){return!!t&&(n.isObject(t)?!!t.id&&(this.id&&t.id&&this.id===t.id):this.id===t)},s.prototype.copyProperty=function(t,e){this[e]&&n.isFunction(this[e].clone)?t[e]=this[e].clone():t[e]=n.copy(this[e])},s.prototype.setParent=function(t){this.$parent=t},s.valueFromJSON=function(t){if(n.isArray(t))return t.map(s.valueFromJSON);if(a&&n.isString(t)){var e=i(t);return e||t}if(t&&n.isObject(t)){if(t._isAMomentObject)return t.clone();var r={};for(var o in t)t.hasOwnProperty(o)&&(r[o]=s.valueFromJSON(t[o]));return r}return t},s.valueToJSON=function(t){if(n.isArray(t))return t.map(s.valueToJSON);if(t&&n.isObject(t)){if(n.isFunction(t.toJSON))return t.toJSON();var e={};for(var r in t)t.hasOwnProperty(r)&&"$$"!==r.substr(0,2)&&(e[r]=s.valueToJSON(t[r]));return e}return t},s.onlyId=function(t){return n.isArray(t)?t.map(s.onlyId):t&&"object"===("undefined"==typeof t?"undefined":_typeof(t))&&t.id?t.id:t},s.strip=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return n.isArray(t)?t.map(function(t){return s.strip.apply(s,[t].concat(r))}):t&&"object"===("undefined"==typeof t?"undefined":_typeof(t))?(n.forEach(t,function(n,e){r.includes(e)||delete t[e]}),t):t},s.stripIds=function(t){return n.isArray(t)?t.map(function(t){return s.stripIds(t)}):t&&"object"===("undefined"==typeof t?"undefined":_typeof(t))?("undefined"!=typeof t.id&&delete t.id,n.forEach(t,function(t){t&&"object"===("undefined"==typeof t?"undefined":_typeof(t))&&s.stripIds(t)}),t):t},s.isId=function(t){return t.match(/^[a-f\d]{24}$/i)},s}])}(window,window.angular),function(t,n,e){"use strict";n.module("Api.Endpoint.Service",["Api.Action.Service","Api.Request.Service","Url.Service"]).factory("$apiEndpoint",["$url","$apiAction","$apiRequest",function(t,e,r){function i(i,o){var s=this;o.actions=o.actions||{},o.url=t.concat(o.baseUrl,o.url||t.concat(i,":id")),this.$config=o,this.$actions={},n.forEach(o.actions,function(t,i){s.$actions[i]=e(t||{},o),s[i]=n.bind(s,r,s.$actions[i])})}return function(t,n){return new i(t,n)}}])}(window,window.angular),function(t,n,e){"use strict";n.module("Api.Request.Service",["Url.Service"]).factory("$apiRequest",["$http","$url",function(t,r){function i(t){return t&&"hasOwnProperty"!==t&&/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/.test("."+t)}function o(t,n){if(!i(n))throw new Error("Invalid dotted path:"+n);for(var r=n.split("."),o=0;o<r.length&&t!==e;o++){var s=r[o];t=null!==t?t[s]:e}return t}function s(t,e,r){var i={};return n.forEach(t||{},function(t,e){n.isFunction(t)&&(t=t()),n.isString(t)&&"@"===t.charAt(0)&&(t=o(r,t.substr(1))),i[e]=t}),n.extend(i,e||{})}function a(t){var e={};return n.forEach(t.split(/\W/),function(n){if("hasOwnProperty"===n)throw new Error("Invalid parameter name: hasOwnProperty");n&&!/^\\d+$/.test(n)&&new RegExp("(^|[^\\\\]):"+n+"(\\W|$)").test(t)&&(e[n]=!0)}),e}function u(t,n){return n&&(t=t.replace(/\/+$/,"")||"/"),t.replace(/\/\.(?=\w+($|\?))/,".").replace(/\/\\\./,"/.")}function c(t,e,i,o){return t=t.replace(/\\:/g,":"),n.forEach(i,function(i,o){var s=e.hasOwnProperty(o)?e[o]:null,a=void 0;n.isDefined(s)&&null!==s?!function(){var n=r.encodeUriSegment(s);a=new RegExp(":"+o+"(\\W|$)","g"),t=t.replace(a,function(t,e){return n+e})}():(a=new RegExp("(/?):"+o+"(\\W|$)","g"),t=t.replace(a,function(t,n,e){return"/"===e.charAt(0)?e:n+e}))}),u(t,o)}function f(t,e,r,i){var o={},u=["params","model","isArray","isModel","successInterceptor","errorInterceptor","stripTrailingSlashes"];if(n.forEach(t,function(t,e){u.indexOf(e)===-1&&(o[e]=n.copy(t))}),i&&n.isObject(i)&&n.forEach(i,function(t,e){o[e]=n.copy(t)}),t.hasBody()&&r&&n.isObject(r)&&(n.isFunction(r.toJSON)?o.data=r.toJSON():n.isArray(r)?o.data=r:o.data=n.extend({},r)),e=n.copy(e),e&&n.isObject(e))for(var f in e)e.hasOwnProperty(f)&&n.isObject(e[f])&&n.isFunction(e[f].toJSON)&&(e[f]=e[f].toJSON());e=s(t.params,e,r);var p=a(o.url);return o.url=c(t.url,e,p,t.stripTrailingSlashes),n.forEach(e,function(t,n){p[n]||(o.params=o.params||{},o.params[n]=t)}),o}return function(n,e,r,i){n.hasBody()&&e&&!r&&(r=e,e=null);var o=f(n,e,r,i);return t(o).then(function(t){return n.successInterceptor(t)})["catch"](function(t){return n.errorInterceptor(t)})}}])}(window,window.angular); | ||
//# sourceMappingURL=angular-api.min.js.map |
@@ -114,2 +114,7 @@ | ||
//Already a model? | ||
if (this[key] instanceof Model) { | ||
return; | ||
} | ||
//Get model class and initiate | ||
@@ -116,0 +121,0 @@ if (angular.isArray(this[key])) { |
Sorry, the diff of this file is not supported yet
140888
1921