diff --git a/bower.json b/bower.json index ae50ca5..f7094cd 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "angular-cakephp", "description": "An AngularJS data modelling framework that ties in with a CakePHP REST API", - "version": "0.4.1", + "version": "0.4.2", "homepage": "https://github.com/intellipharm/angular-cakephp", "repository": { "type": "git", diff --git a/dist/angular-cakephp.js b/dist/angular-cakephp.js index 5cfee42..dac8ca0 100644 --- a/dist/angular-cakephp.js +++ b/dist/angular-cakephp.js @@ -1,10 +1,10 @@ /*! - * angular-cakephp v0.4.1 + * angular-cakephp v0.4.2 * http://intellipharm.com/ * * Copyright 2015 Intellipharm * - * 2015-05-08 15:05:48 + * 2015-05-20 10:55:16 * */ (function() { @@ -109,6 +109,20 @@ return instance; }; + //----------------------------------------------- + // clone + //----------------------------------------------- + + /** + * clone + * Extends BaseActiveRecord + * + * @returns cloned active record instance + */ + BaseActiveRecord.prototype.clone = function() { + return this.new(this); + }; + //----------------------------------------------- // C.R.U.D //----------------------------------------------- @@ -675,9 +689,6 @@ throw new Error(self.ERROR_MISSING_PARAMS); } - // format url params - url_params = '';// TODO: url param conversion - // format url var url = TransformerService.transformRequestUrl(self.config.api, self.config.api_endpoint + '/' + end_point, url_params); @@ -960,8 +971,10 @@ // create url params string var params_str = ''; - if (params_array.length > 0) { + if (_.isArray(params_array) && params_array.length > 0) { params_str = '?' + params_array.join('&'); + } else if (params_array.length > 0) { + params_str = '?' + params_array; } // create request url diff --git a/dist/angular-cakephp.min.js b/dist/angular-cakephp.min.js index adf2e0a..e5e7aa0 100644 --- a/dist/angular-cakephp.min.js +++ b/dist/angular-cakephp.min.js @@ -1,11 +1,11 @@ /*! - * angular-cakephp v0.4.1 + * angular-cakephp v0.4.2 * http://intellipharm.com/ * * Copyright 2015 Intellipharm * - * 2015-05-08 15:05:48 + * 2015-05-20 10:55:16 * */ -!function(){"use strict";angular.module("AngularCakePHP",[])}(),function(){"use strict";angular.module("AngularCakePHP").value("AngularCakePHPApiUrl","").value("AngularCakePHPTimestamps",!0).value("AngularCakePHPApiEndpointTransformer",null).value("AngularCakePHPUrlParamTransformer",null).value("AngularCakePHPApiIndexResponseTransformer",null).value("AngularCakePHPApiViewResponseTransformer",null).value("AngularCakePHPApiEditResponseTransformer",null).value("AngularCakePHPApiAddResponseTransformer",null).value("AngularCakePHPApiDeleteResponseTransformer",null).value("AngularCakePHPApiValidateResponseTransformer",null).value("AngularCakePHPApiValidateErrorResponseTransformer",null).value("AngularCakePHPApiErrorResponseTransformer",null)}(),function(){"use strict";function a(){this.model=null}var b="Missing Required Params",c="Name argument is required",d="Name argument needs to be a string",e="Name argument is not in the object",f="Name argument is not a virtual field",g="Value argument is required",h="Value argument needs to be a function";a.$inject=[],a.prototype.extend=function(c,d){if(_.isUndefined(c)||!_.has(c,"active_record_class")||_.isUndefined(c.active_record_class)||_.isUndefined(d))throw new Error(b);c.active_record_class.prototype=Object.create(a.prototype);var e=new c.active_record_class(d);return c.config.timestamps&&(e.created=d.created,e.modified=d.modified),Object.defineProperty(e,"model",{configurable:!1,enumerable:!1,value:c,writable:!1}),e},a.prototype.save=function(){return this.id?this.model.edit(this.id,this):this.model.add(this)},a.prototype.new=function(a){return this.model.new(a)},a.prototype.delete=function(){return this.model.delete(this.id)},a.prototype.validate=function(a){return this.model.validate(this,a)},a.prototype.api=function(a,b,c){return this.model.api(a,b,c,this)},a.prototype.getClassName=function(){return this.model&&this.model.active_record_class?this.model.active_record_class.name:null},a.prototype.virtualField=function(a,b){var e;if(!a)throw new Error(c);if("string"!=typeof a)throw new Error(d);if(!b)throw new Error(g);if("function"!=typeof b)throw new Error(h);return Object.defineProperty(this,a,{enumerable:!1,configurable:!1,get:function(){return e},set:function(){return e=b.apply(this)}}),this.virtualFieldUpdate(a),this},a.prototype.virtualFieldUpdate=function(a){if(!a)throw new Error(c);if("string"!=typeof a)throw new Error(d);if(!_.has(this,a))throw new Error(e);if(this.propertyIsEnumerable(a))throw new Error(f);return this[a]="",this},angular.module("AngularCakePHP").service("BaseActiveRecord",a)}(),function(){"use strict";function a(a,j,l,m,n,o,p,q,r){b=a,c=j,d=l,i=m,e=n,f=o,g=p,h=q;try{k=c.get("AngularCakePHPApiEndpointTransformer")}catch(a){}this.active_record_class=null,this.config={api:i,api_endpoint:null,timestamps:r}}var b,c,d,e,f,g,h,i,j="Missing Required Params",k=null;a.$inject=["$http","$injector","$q","AngularCakePHPApiUrl","UtilService","HttpResponseService","TransformerService","BaseActiveRecord","AngularCakePHPTimestamps"],a.prototype.extend=function(b,c){if(c.prototype.name||Object.defineProperty(c.prototype,"name",{get:function(){var a=/function\s([^(]{1,})\(/,b=a.exec(this.toString());return b&&b.length>1?b[1].trim():""},set:function(){}}),_.isUndefined(b)||_.isUndefined(c))throw new Error(j);b.prototype=Object.create(a.prototype);var d=new b;return d.active_record_class=c,d.config=_.merge(_.clone(this.config),d.config),_.isNull(d.config.api_endpoint)&&(d.config.api_endpoint=_.snakeCase(d.active_record_class.name),_.isNull(k)||(d.config.api_endpoint=k(d.config.api_endpoint))),d},a.prototype.new=function(a){_.isUndefined(a)&&(a={});var b=h.extend(this,a);return _.forEach(a,function(a,c){if(_.isArray(a)){var d=e.getAssociationArray(a,c);_.isEmpty(d)||(b[c]=d)}else if(_.isObject(a)){var f=e.getAssociation(a,c);f!==!1&&(b[c]=f)}},this),b},a.prototype.index=function(a){var c=this;return d(function(d,e){var h=g.transformRequestUrl(c.config.api,c.config.api_endpoint,a);b.get(h).success(function(a,b,g,h){f.handleIndexResponse(d,e,c,a,b,g,h)}).error(function(a,b,g,h){f.handleErrorResponse(d,e,c,a,b,g,h)})})},a.prototype.view=function(a,c){var e=this;if(_.isNull(a)||_.isUndefined(a))throw new Error(j);return d(function(d,h){var i=g.transformRequestUrl(e.config.api,e.config.api_endpoint,c,a);b.get(i).success(function(a,b,c,g){f.handleViewResponse(d,h,e,a,b,c,g)}).error(function(a,b,c,g){f.handleErrorResponse(d,h,e,a,b,c,g)})})},a.prototype.add=function(a){var c=this;if(_.isNull(a)||_.isUndefined(a))throw new Error(j);return d(function(d,e){var h=g.transformRequestUrl(c.config.api,c.config.api_endpoint);a=g.transformRequestData(a),b.post(h,a).success(function(a,b,g,h){f.handleAddResponse(d,e,c,a,b,g,h)}).error(function(a,b,g,h){f.handleErrorResponse(d,e,c,a,b,g,h)})})},a.prototype.edit=function(a,c){var e=this;if(_.isNull(a)||_.isUndefined(a))throw new Error(j);if(_.isNull(c)||_.isUndefined(c))throw new Error(j);return d(function(d,h){var i=g.transformRequestUrl(e.config.api,e.config.api_endpoint,null,a);c=g.transformRequestData(c),b.put(i,c).success(function(a,b,c,g){f.handleEditResponse(d,h,e,a,b,c,g)}).error(function(a,b,c,g){f.handleErrorResponse(d,h,e,a,b,c,g)})})},a.prototype.delete=function(a){var c=this;if(_.isNull(a)||_.isUndefined(a))throw new Error(c.ERROR_MISSING_PARAMS);return d(function(d,e){var h=g.transformRequestUrl(c.config.api,c.config.api_endpoint,null,a);b.delete(h).success(function(a,b,g,h){f.handleDeleteResponse(d,e,c,a,b,g,h)}).error(function(a,b,g,h){f.handleErrorResponse(d,e,c,a,b,g,h)})})},a.prototype.validate=function(a,c){var e=this;if(_.isNull(a)||_.isUndefined(a))throw new Error(e.ERROR_MISSING_PARAMS);return d(function(d,h){var i=null;_.isUndefined(c)||(i={fields:c.join(",")});var j=g.transformRequestUrl(e.config.api,e.config.api_endpoint+"/validation",i),k=a;b.post(j,k).success(function(a,b,c,g){f.handleValidateResponse(d,h,e,a,b,c,g)}).error(function(a,b,c,g){f.handleValidateErrorResponse(d,h,e,a,b,c,g)})})},a.prototype.api=function(a,c,d,e){var f=this;if(_.isUndefined(c)&&(c="GET"),_.isUndefined(d)&&(d={}),_.isUndefined(e)&&(e={}),c=c.toUpperCase(),_.isNull(a)||_.isUndefined(a))throw new Error(f.ERROR_MISSING_PARAMS);d="";var h=g.transformRequestUrl(f.config.api,f.config.api_endpoint+"/"+a,d),i={method:c,url:h};return"POST"===c&&(i.data=e),b(i)},angular.module("AngularCakePHP").service("AngularCakePHPBaseModel",a)}(),function(){"use strict";var a=function(){};a.$inject=[],angular.module("AngularCakePHP").service("HttpRequestService",a)}(),function(){"use strict";var a=function(a,b){this.handleIndexResponse=function(c,d,e,f,g,h,i){var j=a.transformResponseDataList(f.data,e),k=b.get("AngularCakePHPApiIndexResponseTransformer");_.isFunction(k)?k(c,d,e,f,g,h,i,j):c({data:j})},this.handleViewResponse=function(c,d,e,f,g,h,i){var j=a.transformResponseData(f.data,e),k=b.get("AngularCakePHPApiViewResponseTransformer");_.isFunction(k)?k(c,d,e,f,g,h,i,j):c({data:j})},this.handleAddResponse=function(a,c,d,e,f,g,h){var i=b.get("AngularCakePHPApiEditResponseTransformer");_.isFunction(i)?i(a,c,d,e,f,g,h,data):a({message:e.message,data:e.data})},this.handleEditResponse=function(a,c,d,e,f,g,h){var i=b.get("AngularCakePHPApiAddResponseTransformer");_.isFunction(i)?i(a,c,d,e,f,g,h,data):a({message:e.message})},this.handleDeleteResponse=function(a,c,d,e,f,g,h){var i=b.get("AngularCakePHPApiDeleteResponseTransformer");_.isFunction(i)?i(a,c,d,e,f,g,h,data):a({message:e.message})},this.handleValidateResponse=function(a,c,d,e,f,g,h){var i=b.get("AngularCakePHPApiValidateResponseTransformer");_.isFunction(i)?i(a,c,d,e,f,g,h,data):a({message:e.message})},this.handleValidateErrorResponse=function(a,c,d,e,f,g,h){var i=b.get("AngularCakePHPApiValidateErrorResponseTransformer");_.isFunction(i)?i(a,c,d,e,f,g,h,data):c({data:e.data,message:e.message})},this.handleErrorResponse=function(a,c,d,e,f,g,h){var i=b.get("AngularCakePHPApiErrorResponseTransformer");_.isFunction(i)?i(a,c,d,e,f,g,h,data):c({data:e.data,message:e.message})}};a.$inject=["TransformerService","$injector"],angular.module("AngularCakePHP").service("HttpResponseService",a)}(),function(){"use strict";var a=function(a){var b=null;try{b=a.get("AngularCakePHPUrlParamTransformer")}catch(a){}this.transformRequestUrl=function(a,c,d,e){var f=[];_.isUndefined(d)||_.isNull(d)||_.isEmpty(d)||(_.isNull(b)?_.forEach(d,function(a,b){b&&a&&f.push(b+"="+a)}):f=b(d));var g="";f.length>0&&(g="?"+f.join("&"));var h=_.isUndefined(e)||_.isNull(e)?"":"/"+e,i=a+"/"+c+h+g;return i=i.replace(/([^:]\/)\/+/g,"$1")},this.transformRequestData=function(a){return a},this.transformResponseDataList=function(a,b){var c=[];return _.forEach(a,function(a){c.push(this.transformResponseData(a,b))},this),c},this.transformResponseData=function(a,b){return _.merge(a,a[b.active_record_class.name]),delete a[b.active_record_class.name],b.new(a)}};a.$inject=["$injector"],angular.module("AngularCakePHP").service("TransformerService",a)}(),function(){"use strict";var a=function(a){var b=this;this.ERROR_MODEL_DOES_NOT_EXIST="Model does not exist",this.ERROR_NO_DATA="No Data",this.getAssociationArray=function(a,b){var c=[],d=b+"Model";return _.forEach(a,function(a){var e=this.getAssociation(a,b,d);e!==!1&&c.push(e)},this),c},this.getAssociation=function(c,d,e){if(_.isNumber(c))return c;if(_.isUndefined(e)&&(e=d+"Model"),_.has(c,"id")&&_.isNull(c.id))return console.error(b.ERROR_NO_DATA+": "+e),!1;try{var f=a.get(e),g=f.new(c);return g}catch(a){return console.error(b.ERROR_MODEL_DOES_NOT_EXIST+": "+e),!1}}};a.$inject=["$injector"],angular.module("AngularCakePHP").service("UtilService",a)}(); +!function(){"use strict";angular.module("AngularCakePHP",[])}(),function(){"use strict";angular.module("AngularCakePHP").value("AngularCakePHPApiUrl","").value("AngularCakePHPTimestamps",!0).value("AngularCakePHPApiEndpointTransformer",null).value("AngularCakePHPUrlParamTransformer",null).value("AngularCakePHPApiIndexResponseTransformer",null).value("AngularCakePHPApiViewResponseTransformer",null).value("AngularCakePHPApiEditResponseTransformer",null).value("AngularCakePHPApiAddResponseTransformer",null).value("AngularCakePHPApiDeleteResponseTransformer",null).value("AngularCakePHPApiValidateResponseTransformer",null).value("AngularCakePHPApiValidateErrorResponseTransformer",null).value("AngularCakePHPApiErrorResponseTransformer",null)}(),function(){"use strict";function a(){this.model=null}var b="Missing Required Params",c="Name argument is required",d="Name argument needs to be a string",e="Name argument is not in the object",f="Name argument is not a virtual field",g="Value argument is required",h="Value argument needs to be a function";a.$inject=[],a.prototype.extend=function(c,d){if(_.isUndefined(c)||!_.has(c,"active_record_class")||_.isUndefined(c.active_record_class)||_.isUndefined(d))throw new Error(b);c.active_record_class.prototype=Object.create(a.prototype);var e=new c.active_record_class(d);return c.config.timestamps&&(e.created=d.created,e.modified=d.modified),Object.defineProperty(e,"model",{configurable:!1,enumerable:!1,value:c,writable:!1}),e},a.prototype.clone=function(){return this.new(this)},a.prototype.save=function(){return this.id?this.model.edit(this.id,this):this.model.add(this)},a.prototype.new=function(a){return this.model.new(a)},a.prototype.delete=function(){return this.model.delete(this.id)},a.prototype.validate=function(a){return this.model.validate(this,a)},a.prototype.api=function(a,b,c){return this.model.api(a,b,c,this)},a.prototype.getClassName=function(){return this.model&&this.model.active_record_class?this.model.active_record_class.name:null},a.prototype.virtualField=function(a,b){var e;if(!a)throw new Error(c);if("string"!=typeof a)throw new Error(d);if(!b)throw new Error(g);if("function"!=typeof b)throw new Error(h);return Object.defineProperty(this,a,{enumerable:!1,configurable:!1,get:function(){return e},set:function(){return e=b.apply(this)}}),this.virtualFieldUpdate(a),this},a.prototype.virtualFieldUpdate=function(a){if(!a)throw new Error(c);if("string"!=typeof a)throw new Error(d);if(!_.has(this,a))throw new Error(e);if(this.propertyIsEnumerable(a))throw new Error(f);return this[a]="",this},angular.module("AngularCakePHP").service("BaseActiveRecord",a)}(),function(){"use strict";function a(a,j,l,m,n,o,p,q,r){b=a,c=j,d=l,i=m,e=n,f=o,g=p,h=q;try{k=c.get("AngularCakePHPApiEndpointTransformer")}catch(a){}this.active_record_class=null,this.config={api:i,api_endpoint:null,timestamps:r}}var b,c,d,e,f,g,h,i,j="Missing Required Params",k=null;a.$inject=["$http","$injector","$q","AngularCakePHPApiUrl","UtilService","HttpResponseService","TransformerService","BaseActiveRecord","AngularCakePHPTimestamps"],a.prototype.extend=function(b,c){if(c.prototype.name||Object.defineProperty(c.prototype,"name",{get:function(){var a=/function\s([^(]{1,})\(/,b=a.exec(this.toString());return b&&b.length>1?b[1].trim():""},set:function(){}}),_.isUndefined(b)||_.isUndefined(c))throw new Error(j);b.prototype=Object.create(a.prototype);var d=new b;return d.active_record_class=c,d.config=_.merge(_.clone(this.config),d.config),_.isNull(d.config.api_endpoint)&&(d.config.api_endpoint=_.snakeCase(d.active_record_class.name),_.isNull(k)||(d.config.api_endpoint=k(d.config.api_endpoint))),d},a.prototype.new=function(a){_.isUndefined(a)&&(a={});var b=h.extend(this,a);return _.forEach(a,function(a,c){if(_.isArray(a)){var d=e.getAssociationArray(a,c);_.isEmpty(d)||(b[c]=d)}else if(_.isObject(a)){var f=e.getAssociation(a,c);f!==!1&&(b[c]=f)}},this),b},a.prototype.index=function(a){var c=this;return d(function(d,e){var h=g.transformRequestUrl(c.config.api,c.config.api_endpoint,a);b.get(h).success(function(a,b,g,h){f.handleIndexResponse(d,e,c,a,b,g,h)}).error(function(a,b,g,h){f.handleErrorResponse(d,e,c,a,b,g,h)})})},a.prototype.view=function(a,c){var e=this;if(_.isNull(a)||_.isUndefined(a))throw new Error(j);return d(function(d,h){var i=g.transformRequestUrl(e.config.api,e.config.api_endpoint,c,a);b.get(i).success(function(a,b,c,g){f.handleViewResponse(d,h,e,a,b,c,g)}).error(function(a,b,c,g){f.handleErrorResponse(d,h,e,a,b,c,g)})})},a.prototype.add=function(a){var c=this;if(_.isNull(a)||_.isUndefined(a))throw new Error(j);return d(function(d,e){var h=g.transformRequestUrl(c.config.api,c.config.api_endpoint);a=g.transformRequestData(a),b.post(h,a).success(function(a,b,g,h){f.handleAddResponse(d,e,c,a,b,g,h)}).error(function(a,b,g,h){f.handleErrorResponse(d,e,c,a,b,g,h)})})},a.prototype.edit=function(a,c){var e=this;if(_.isNull(a)||_.isUndefined(a))throw new Error(j);if(_.isNull(c)||_.isUndefined(c))throw new Error(j);return d(function(d,h){var i=g.transformRequestUrl(e.config.api,e.config.api_endpoint,null,a);c=g.transformRequestData(c),b.put(i,c).success(function(a,b,c,g){f.handleEditResponse(d,h,e,a,b,c,g)}).error(function(a,b,c,g){f.handleErrorResponse(d,h,e,a,b,c,g)})})},a.prototype.delete=function(a){var c=this;if(_.isNull(a)||_.isUndefined(a))throw new Error(c.ERROR_MISSING_PARAMS);return d(function(d,e){var h=g.transformRequestUrl(c.config.api,c.config.api_endpoint,null,a);b.delete(h).success(function(a,b,g,h){f.handleDeleteResponse(d,e,c,a,b,g,h)}).error(function(a,b,g,h){f.handleErrorResponse(d,e,c,a,b,g,h)})})},a.prototype.validate=function(a,c){var e=this;if(_.isNull(a)||_.isUndefined(a))throw new Error(e.ERROR_MISSING_PARAMS);return d(function(d,h){var i=null;_.isUndefined(c)||(i={fields:c.join(",")});var j=g.transformRequestUrl(e.config.api,e.config.api_endpoint+"/validation",i),k=a;b.post(j,k).success(function(a,b,c,g){f.handleValidateResponse(d,h,e,a,b,c,g)}).error(function(a,b,c,g){f.handleValidateErrorResponse(d,h,e,a,b,c,g)})})},a.prototype.api=function(a,c,d,e){var f=this;if(_.isUndefined(c)&&(c="GET"),_.isUndefined(d)&&(d={}),_.isUndefined(e)&&(e={}),c=c.toUpperCase(),_.isNull(a)||_.isUndefined(a))throw new Error(f.ERROR_MISSING_PARAMS);var h=g.transformRequestUrl(f.config.api,f.config.api_endpoint+"/"+a,d),i={method:c,url:h};return"POST"===c&&(i.data=e),b(i)},angular.module("AngularCakePHP").service("AngularCakePHPBaseModel",a)}(),function(){"use strict";var a=function(){};a.$inject=[],angular.module("AngularCakePHP").service("HttpRequestService",a)}(),function(){"use strict";var a=function(a,b){this.handleIndexResponse=function(c,d,e,f,g,h,i){var j=a.transformResponseDataList(f.data,e),k=b.get("AngularCakePHPApiIndexResponseTransformer");_.isFunction(k)?k(c,d,e,f,g,h,i,j):c({data:j})},this.handleViewResponse=function(c,d,e,f,g,h,i){var j=a.transformResponseData(f.data,e),k=b.get("AngularCakePHPApiViewResponseTransformer");_.isFunction(k)?k(c,d,e,f,g,h,i,j):c({data:j})},this.handleAddResponse=function(a,c,d,e,f,g,h){var i=b.get("AngularCakePHPApiEditResponseTransformer");_.isFunction(i)?i(a,c,d,e,f,g,h,data):a({message:e.message,data:e.data})},this.handleEditResponse=function(a,c,d,e,f,g,h){var i=b.get("AngularCakePHPApiAddResponseTransformer");_.isFunction(i)?i(a,c,d,e,f,g,h,data):a({message:e.message})},this.handleDeleteResponse=function(a,c,d,e,f,g,h){var i=b.get("AngularCakePHPApiDeleteResponseTransformer");_.isFunction(i)?i(a,c,d,e,f,g,h,data):a({message:e.message})},this.handleValidateResponse=function(a,c,d,e,f,g,h){var i=b.get("AngularCakePHPApiValidateResponseTransformer");_.isFunction(i)?i(a,c,d,e,f,g,h,data):a({message:e.message})},this.handleValidateErrorResponse=function(a,c,d,e,f,g,h){var i=b.get("AngularCakePHPApiValidateErrorResponseTransformer");_.isFunction(i)?i(a,c,d,e,f,g,h,data):c({data:e.data,message:e.message})},this.handleErrorResponse=function(a,c,d,e,f,g,h){var i=b.get("AngularCakePHPApiErrorResponseTransformer");_.isFunction(i)?i(a,c,d,e,f,g,h,data):c({data:e.data,message:e.message})}};a.$inject=["TransformerService","$injector"],angular.module("AngularCakePHP").service("HttpResponseService",a)}(),function(){"use strict";var a=function(a){var b=null;try{b=a.get("AngularCakePHPUrlParamTransformer")}catch(a){}this.transformRequestUrl=function(a,c,d,e){var f=[];_.isUndefined(d)||_.isNull(d)||_.isEmpty(d)||(_.isNull(b)?_.forEach(d,function(a,b){b&&a&&f.push(b+"="+a)}):f=b(d));var g="";_.isArray(f)&&f.length>0?g="?"+f.join("&"):f.length>0&&(g="?"+f);var h=_.isUndefined(e)||_.isNull(e)?"":"/"+e,i=a+"/"+c+h+g;return i=i.replace(/([^:]\/)\/+/g,"$1")},this.transformRequestData=function(a){return a},this.transformResponseDataList=function(a,b){var c=[];return _.forEach(a,function(a){c.push(this.transformResponseData(a,b))},this),c},this.transformResponseData=function(a,b){return _.merge(a,a[b.active_record_class.name]),delete a[b.active_record_class.name],b.new(a)}};a.$inject=["$injector"],angular.module("AngularCakePHP").service("TransformerService",a)}(),function(){"use strict";var a=function(a){var b=this;this.ERROR_MODEL_DOES_NOT_EXIST="Model does not exist",this.ERROR_NO_DATA="No Data",this.getAssociationArray=function(a,b){var c=[],d=b+"Model";return _.forEach(a,function(a){var e=this.getAssociation(a,b,d);e!==!1&&c.push(e)},this),c},this.getAssociation=function(c,d,e){if(_.isNumber(c))return c;if(_.isUndefined(e)&&(e=d+"Model"),_.has(c,"id")&&_.isNull(c.id))return console.error(b.ERROR_NO_DATA+": "+e),!1;try{var f=a.get(e),g=f.new(c);return g}catch(a){return console.error(b.ERROR_MODEL_DOES_NOT_EXIST+": "+e),!1}}};a.$inject=["$injector"],angular.module("AngularCakePHP").service("UtilService",a)}(); //# sourceMappingURL=angular-cakephp.min.map \ No newline at end of file diff --git a/dist/angular-cakephp.min.map b/dist/angular-cakephp.min.map index b42c018..600a642 100644 --- a/dist/angular-cakephp.min.map +++ b/dist/angular-cakephp.min.map @@ -1 +1 @@ -{"version":3,"file":"angular-cakephp.min.js","sources":["../lib/angular-cakephp.js","../lib/angular-cakephp-settings.js","../lib/base/base-active-record.js","../lib/base/base-model.js","../lib/http/http-request-service.js","../lib/http/http-response-service.js","../lib/transformers/transformer-service.js","../lib/util/util-service.js"],"names":["angular","module","value","BaseActiveRecord","this","model","ERROR_MISSING_PARAMS","ERROR_VIRTUAL_FIELD_NAME","ERROR_VIRTUAL_FIELD_NAME_NOT_STRING","ERROR_VIRTUAL_FIELD_NAME_NOT_FIELD","ERROR_VIRTUAL_FIELD_NAME_NOT_VIRTUAL_FIELD","ERROR_VIRTUAL_FIELD_VALUE","ERROR_VIRTUAL_FIELD_VALUE_NOT_FUNCTION","$inject","prototype","extend","data","_","isUndefined","has","active_record_class","Error","Object","create","instance","config","timestamps","created","modified","defineProperty","configurable","enumerable","writable","save","id","edit","add","new","delete","validate","fields","api","end_point","http_method","url_params","getClassName","name","virtualField","valueFn","virtualValue","get","set","apply","virtualFieldUpdate","propertyIsEnumerable","service","BaseModel","_$http","_$injector","_$q","_api_url","_UtilService","_HttpResponseService","_TransformerService","_BaseActiveRecord","AngularCakePHPTimestamps","$http","$injector","$q","api_url","UtilService","HttpResponseService","TransformerService","apiEndpointTransformer","e","api_endpoint","Model","active_record","funcNameRegex","results","exec","toString","length","trim","merge","clone","isNull","snakeCase","forEach","item","key","isArray","result_array","getAssociationArray","isEmpty","isObject","result_item","getAssociation","index","params","self","resolve","reject","url","transformRequestUrl","success","response","status","headers","handleIndexResponse","error","handleErrorResponse","view","handleViewResponse","transformRequestData","post","handleAddResponse","put","handleEditResponse","handleDeleteResponse","get_params","join","post_params","handleValidateResponse","handleValidateErrorResponse","toUpperCase","http_params","method","HttpRequestService","transformResponseDataList","angularCakePHPApiIndexResponseTransformer","isFunction","transformResponseData","angularCakePHPApiViewResponseTransformer","angularCakePHPApiEditResponseTransformer","message","angularCakePHPApiAddResponseTransformer","angularCakePHPApiDeleteResponseTransformer","angularCakePHPApiValidateResponseTransformer","angularCakePHPApiValidateErrorResponseTransformer","angularCakePHPApiErrorResponseTransformer","urlParamTransformer","params_array","push","params_str","id_str","result","replace","ERROR_MODEL_DOES_NOT_EXIST","ERROR_NO_DATA","model_class","isNumber","console"],"mappings":";;;;;;;;;CAAA,WAEI,YAMAA,SAAQC,OAAO,wBCRnB,WACI,YAEAD,SAAQC,OAAO,kBACVC,MAAM,uBAAwB,IAC9BA,MAAM,4BAA4B,GAClCA,MAAM,uCAAwC,MAC9CA,MAAM,oCAAqC,MAC3CA,MAAM,4CAA6C,MACnDA,MAAM,2CAA4C,MAClDA,MAAM,2CAA4C,MAClDA,MAAM,0CAA2C,MACjDA,MAAM,6CAA8C,MACpDA,MAAM,+CAAgD,MACtDA,MAAM,oDAAqD,MAC3DA,MAAM,4CAA6C,SCf5D,WAEI,YAuBA,S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C,OAAO,kBAAkBsD,QAAQ,qBAAsBiB,MC3GnE,WAEI,YAMA,IAAIF,GAAc,SAASH,GAEvB,GAAIiC,GAAOhG,IAEXA,MAAKgJ,2BAA6B,uBAClChJ,KAAKiJ,cAA6B,UASlCjJ,KAAKyF,oBAAsB,SAAS7E,EAAM0E,GACtC,GAAIwD,MACAI,EAAc5D,EAAM,OAOxB,OANAzE,GAAEuE,QAAQxE,EAAM,SAASyE,GACrB,GAAIO,GAAc5F,KAAK6F,eAAeR,EAAMC,EAAK4D,EAC7CtD,MAAgB,GAChBkD,EAAOH,KAAK/C,IAEjB5F,MACI8I,GAWX9I,KAAK6F,eAAiB,SAASjF,EAAM0E,EAAK4D,GAGtC,GAAIrI,EAAEsI,SAASvI,GACX,MAAOA,EAQX,IALIC,EAAEC,YAAYoI,KACdA,EAAc5D,EAAM,SAIpBzE,EAAEE,IAAIH,EAAM,OAASC,EAAEqE,OAAOtE,EAAKkB,IAEnC,MADAsH,SAAQ1C,MAAMV,EAAKiD,cAAgB,KAAOC,IACnC,CAGX,KACI,GAAIjJ,GAAQ8D,EAAUjB,IAAIoG,GACtBJ,EAAS7I,EAAMgC,IAAIrB,EACvB,OAAOkI,GACT,MAAOpC,GAEL,MADA0C,SAAQ1C,MAAMV,EAAKgD,2BAA6B,KAAOE,IAChD,IAKnBhF,GAAYzD,SAAW,aAEvBb,QAAQC,OAAO,kBAAkBsD,QAAQ,cAAee"} \ No newline at end of file +{"version":3,"file":"angular-cakephp.min.js","sources":["../lib/angular-cakephp.js","../lib/angular-cakephp-settings.js","../lib/base/base-active-record.js","../lib/base/base-model.js","../lib/http/http-request-service.js","../lib/http/http-response-service.js","../lib/transformers/transformer-service.js","../lib/util/util-service.js"],"names":["angular","module","value","BaseActiveRecord","this","model","ERROR_MISSING_PARAMS","ERROR_VIRTUAL_FIELD_NAME","ERROR_VIRTUAL_FIELD_NAME_NOT_STRING","ERROR_VIRTUAL_FIELD_NAME_NOT_FIELD","ERROR_VIRTUAL_FIELD_NAME_NOT_VIRTUAL_FIELD","ERROR_VIRTUAL_FIELD_VALUE","ERROR_VIRTUAL_FIELD_VALUE_NOT_FUNCTION","$inject","prototype","extend","data","_","isUndefined","has","active_record_class","Error","Object","create","instance","config","timestamps","created","modified","defineProperty","configurable","enumerable","writable","clone","new","save","id","edit","add","delete","validate","fields","api","end_point","http_method","url_params","getClassName","name","virtualField","valueFn","virtualValue","get","set","apply","virtualFieldUpdate","propertyIsEnumerable","service","BaseModel","_$http","_$injector","_$q","_api_url","_UtilService","_HttpResponseService","_TransformerService","_BaseActiveRecord","AngularCakePHPTimestamps","$http","$injector","$q","api_url","UtilService","HttpResponseService","TransformerService","apiEndpointTransformer","e","api_endpoint","Model","active_record","funcNameRegex","results","exec","toString","length","trim","merge","isNull","snakeCase","forEach","item","key","isArray","result_array","getAssociationArray","isEmpty","isObject","result_item","getAssociation","index","params","self","resolve","reject","url","transformRequestUrl","success","response","status","headers","handleIndexResponse","error","handleErrorResponse","view","handleViewResponse","transformRequestData","post","handleAddResponse","put","handleEditResponse","handleDeleteResponse","get_params","join","post_params","handleValidateResponse","handleValidateErrorResponse","toUpperCase","http_params","method","HttpRequestService","transformResponseDataList","angularCakePHPApiIndexResponseTransformer","isFunction","transformResponseData","angularCakePHPApiViewResponseTransformer","angularCakePHPApiEditResponseTransformer","message","angularCakePHPApiAddResponseTransformer","angularCakePHPApiDeleteResponseTransformer","angularCakePHPApiValidateResponseTransformer","angularCakePHPApiValidateErrorResponseTransformer","angularCakePHPApiErrorResponseTransformer","urlParamTransformer","params_array","push","params_str","id_str","result","replace","ERROR_MODEL_DOES_NOT_EXIST","ERROR_NO_DATA","model_class","isNumber","console"],"mappings":";;;;;;;;;CAAA,WAEI,YAMAA,SAAQC,OAAO,wBCRnB,WACI,YAEAD,SAAQC,OAAO,kBACVC,MAAM,uBAAwB,IAC9BA,MAAM,4BAA4B,GAClCA,MAAM,uCAAwC,MAC9CA,MAAM,oCAAqC,MAC3CA,MAAM,4CAA6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644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-cakephp", - "version": "0.4.1", + "version": "0.4.2", "dependencies": {}, "repository": { "type": "git", diff --git a/tests/coverage/index.html b/tests/coverage/index.html index 5af6269..ae4f818 100644 --- a/tests/coverage/index.html +++ b/tests/coverage/index.html @@ -110,7 +110,7 @@