<NME> ng-rest-api.min.js
<BEF> !function(e){function t(a){if(n[a])return n[a].exports;var r=n[a]={exports:{},id:a,loaded:!1};return e[a].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=a(r);t["default"]=angular.module("ng-rest-api",["ngResource","angular-cache"]).provider("api",i["default"])},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),o=n(2),u=a(o),s=n(3),c=a(s),l=function(){function e(){r(this,e),this.baseRoute="",this.httpParamSerializerJQLikeMode=!1,this.endpoints={}}return i(e,[{key:"setBaseRoute",value:function(e){this.baseRoute=e}},{key:"enableHttpParamSerializerJQLikeMode",value:function(){this.httpParamSerializerJQLikeMode=!0}},{key:"endpoint",value:function(e){var t=new u["default"];return this.endpoints[e]=t,t}},{key:"$get",value:["$injector",function(e){"ngInject";var t=this,n={};return angular.forEach(this.endpoints,function(a,r){n[r]=e.instantiate(c["default"],{baseRoute:t.baseRoute,httpParamSerializerJQLikeMode:t.httpParamSerializerJQLikeMode,endpointConfig:a})}),n}]}]),e}();t["default"]=l},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),r=function(){function e(){var t=this;n(this,e),this.actions={},this.modelClass=!1;var a={GET:"get",PUT:"update",POST:"save",PATCH:"patch",DELETE:"remove"};angular.forEach(a,function(e,n){t.addHttpAction(n,e)})}return a(e,[{key:"route",value:function(e){return this.route=e,this}},{key:"model",value:function(e){return this.modelClass=e,this}},{key:"addHttpAction",value:function(e,t,n){return this.actions[t]=angular.merge({method:e.toUpperCase()},n),this}}]),e}();t["default"]=r},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),r=function(){function e(t,a,r,i,o,u,s,c){"ngInject";var l=this;n(this,e),this.config=r,this.$injector=o,this.$q=s,this.resource=u(t+r.route,{},r.actions),this.httpParamSerializerJQLikeMode=a,this.$httpParamSerializerJQLike=i,this.CacheFactory=c,this.cacher=!1,angular.isString(this.config.modelClass)&&(this.config.modelClass=o.get(this.config.modelClass)),angular.forEach(r.actions,function(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];e.method=e.method.toUpperCase();var a=l.request,i=n[t]?n[t]:{},o={name:t,instantiateModel:i.instantiateModel!==!1,headersForReading:i.headersForReading||!1,isSaveRequest:"PUT"===e.method||"POST"===e.method||"PATCH"===e.method};r.model&&(a=o.isSaveRequest?l.saveRequestWithModel:l.getRequestWithModel),l[t]=angular.bind(l,a,o)})}return e.$inject=["baseRoute","httpParamSerializerJQLikeMode","endpointConfig","$httpParamSerializerJQLike","$injector","$resource","$q","CacheFactory"],a(e,[{key:"instantiateModel",value:function(e){var t=this.config.modelClass?new this.config.modelClass(e):e;return t&&angular.isFunction(t.afterLoad)&&t.afterLoad(),t}},{key:"request",value:function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r=!1;(this.httpParamSerializerJQLikeMode&&e.httpParamSerializerJQLikeMode!==!1||e.httpParamSerializerJQLikeMode)&&(a=this.$httpParamSerializerJQLike(a)),this.config.actions[e.name].transformResponse=function(t,n){return e.headersForReading&&Array.isArray(e.headersForReading)&&!function(){var t=n();r={},e.headersForReading.map(function(e){t[e]&&(r[e]=t[e])})}(),e.instantiateModel&&t?angular.fromJson(t):{data:t}};var i=!1,o=angular.isString(this.config.actions[e.name].cache)?this.config.actions[e.name].cache:!1;o&&(n.force&&(this.CacheFactory.destroy(o),delete n.force),this.cacher=this.CacheFactory.get(o)||this.CacheFactory.createCache(o,{storageMode:"localStorage"}),i=this.cacher.get(JSON.stringify(Object.assign({},e.name,n,a))));var u=i?new Promise(function(e){return e(i)}):this.resource[e.name](n,a).$promise;u.then(function(i){var o=null;return o=e.instantiateModel?angular.isArray(i)?i.map(function(e){return t.instantiateModel(e)}):function(){return t.instantiateModel(i)}():i.data,o=r?[o,r]:o,t.cacher&&t.cacher.put(JSON.stringify(Object.assign({},e.name,n,a)),o),o})}},{key:"getRequestWithModel",value:function(e,t){return this.request(e,t)}},{key:"saveRequestWithModel",value:function(e,t,n){n||(n=t,t={});var a=angular.copy(n);return a&&angular.isFunction(a.beforeSave)&&a.beforeSave(),this.request(e,t,a)}}]),e}();t["default"]=r}]);

<MSG> Fix cache issue (then after resolve promise)

<DFF> @@ -1,1 +1,1 @@
-!function(e){function t(a){if(n[a])return n[a].exports;var r=n[a]={exports:{},id:a,loaded:!1};return e[a].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=a(r);t["default"]=angular.module("ng-rest-api",["ngResource","angular-cache"]).provider("api",i["default"])},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),o=n(2),u=a(o),s=n(3),c=a(s),l=function(){function e(){r(this,e),this.baseRoute="",this.httpParamSerializerJQLikeMode=!1,this.endpoints={}}return i(e,[{key:"setBaseRoute",value:function(e){this.baseRoute=e}},{key:"enableHttpParamSerializerJQLikeMode",value:function(){this.httpParamSerializerJQLikeMode=!0}},{key:"endpoint",value:function(e){var t=new u["default"];return this.endpoints[e]=t,t}},{key:"$get",value:["$injector",function(e){"ngInject";var t=this,n={};return angular.forEach(this.endpoints,function(a,r){n[r]=e.instantiate(c["default"],{baseRoute:t.baseRoute,httpParamSerializerJQLikeMode:t.httpParamSerializerJQLikeMode,endpointConfig:a})}),n}]}]),e}();t["default"]=l},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),r=function(){function e(){var t=this;n(this,e),this.actions={},this.modelClass=!1;var a={GET:"get",PUT:"update",POST:"save",PATCH:"patch",DELETE:"remove"};angular.forEach(a,function(e,n){t.addHttpAction(n,e)})}return a(e,[{key:"route",value:function(e){return this.route=e,this}},{key:"model",value:function(e){return this.modelClass=e,this}},{key:"addHttpAction",value:function(e,t,n){return this.actions[t]=angular.merge({method:e.toUpperCase()},n),this}}]),e}();t["default"]=r},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),r=function(){function e(t,a,r,i,o,u,s,c){"ngInject";var l=this;n(this,e),this.config=r,this.$injector=o,this.$q=s,this.resource=u(t+r.route,{},r.actions),this.httpParamSerializerJQLikeMode=a,this.$httpParamSerializerJQLike=i,this.CacheFactory=c,this.cacher=!1,angular.isString(this.config.modelClass)&&(this.config.modelClass=o.get(this.config.modelClass)),angular.forEach(r.actions,function(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];e.method=e.method.toUpperCase();var a=l.request,i=n[t]?n[t]:{},o={name:t,instantiateModel:i.instantiateModel!==!1,headersForReading:i.headersForReading||!1,isSaveRequest:"PUT"===e.method||"POST"===e.method||"PATCH"===e.method};r.model&&(a=o.isSaveRequest?l.saveRequestWithModel:l.getRequestWithModel),l[t]=angular.bind(l,a,o)})}return e.$inject=["baseRoute","httpParamSerializerJQLikeMode","endpointConfig","$httpParamSerializerJQLike","$injector","$resource","$q","CacheFactory"],a(e,[{key:"instantiateModel",value:function(e){var t=this.config.modelClass?new this.config.modelClass(e):e;return t&&angular.isFunction(t.afterLoad)&&t.afterLoad(),t}},{key:"request",value:function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r=!1;(this.httpParamSerializerJQLikeMode&&e.httpParamSerializerJQLikeMode!==!1||e.httpParamSerializerJQLikeMode)&&(a=this.$httpParamSerializerJQLike(a)),this.config.actions[e.name].transformResponse=function(t,n){return e.headersForReading&&Array.isArray(e.headersForReading)&&!function(){var t=n();r={},e.headersForReading.map(function(e){t[e]&&(r[e]=t[e])})}(),e.instantiateModel&&t?angular.fromJson(t):{data:t}};var i=!1,o=angular.isString(this.config.actions[e.name].cache)?this.config.actions[e.name].cache:!1;o&&(n.force&&(this.CacheFactory.destroy(o),delete n.force),this.cacher=this.CacheFactory.get(o)||this.CacheFactory.createCache(o,{storageMode:"localStorage"}),i=this.cacher.get(JSON.stringify(Object.assign({},e.name,n,a))));var u=i?new Promise(function(e){return e(i)}):this.resource[e.name](n,a).$promise;u.then(function(i){var o=null;return o=e.instantiateModel?angular.isArray(i)?i.map(function(e){return t.instantiateModel(e)}):function(){return t.instantiateModel(i)}():i.data,o=r?[o,r]:o,t.cacher&&t.cacher.put(JSON.stringify(Object.assign({},e.name,n,a)),o),o})}},{key:"getRequestWithModel",value:function(e,t){return this.request(e,t)}},{key:"saveRequestWithModel",value:function(e,t,n){n||(n=t,t={});var a=angular.copy(n);return a&&angular.isFunction(a.beforeSave)&&a.beforeSave(),this.request(e,t,a)}}]),e}();t["default"]=r}]);
\ No newline at end of file
+!function(e){function t(a){if(n[a])return n[a].exports;var r=n[a]={exports:{},id:a,loaded:!1};return e[a].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=a(r);t["default"]=angular.module("ng-rest-api",["ngResource","angular-cache"]).provider("api",i["default"])},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),o=n(2),u=a(o),s=n(3),c=a(s),l=function(){function e(){r(this,e),this.baseRoute="",this.httpParamSerializerJQLikeMode=!1,this.endpoints={}}return i(e,[{key:"setBaseRoute",value:function(e){this.baseRoute=e}},{key:"enableHttpParamSerializerJQLikeMode",value:function(){this.httpParamSerializerJQLikeMode=!0}},{key:"endpoint",value:function(e){var t=new u["default"];return this.endpoints[e]=t,t}},{key:"$get",value:["$injector",function(e){"ngInject";var t=this,n={};return angular.forEach(this.endpoints,function(a,r){n[r]=e.instantiate(c["default"],{baseRoute:t.baseRoute,httpParamSerializerJQLikeMode:t.httpParamSerializerJQLikeMode,endpointConfig:a})}),n}]}]),e}();t["default"]=l},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),r=function(){function e(){var t=this;n(this,e),this.actions={},this.modelClass=!1;var a={GET:"get",PUT:"update",POST:"save",PATCH:"patch",DELETE:"remove"};angular.forEach(a,function(e,n){t.addHttpAction(n,e)})}return a(e,[{key:"route",value:function(e){return this.route=e,this}},{key:"model",value:function(e){return this.modelClass=e,this}},{key:"addHttpAction",value:function(e,t,n){return this.actions[t]=angular.merge({method:e.toUpperCase()},n),this}}]),e}();t["default"]=r},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),r=function(){function e(t,a,r,i,o,u,s,c){"ngInject";var l=this;n(this,e),this.config=r,this.$injector=o,this.$q=s,this.resource=u(t+r.route,{},r.actions),this.httpParamSerializerJQLikeMode=a,this.$httpParamSerializerJQLike=i,this.CacheFactory=c,this.cacher=!1,angular.isString(this.config.modelClass)&&(this.config.modelClass=o.get(this.config.modelClass)),angular.forEach(r.actions,function(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];e.method=e.method.toUpperCase();var a=l.request,i=n[t]?n[t]:{},o={name:t,instantiateModel:i.instantiateModel!==!1,headersForReading:i.headersForReading||!1,isSaveRequest:"PUT"===e.method||"POST"===e.method||"PATCH"===e.method};r.model&&(a=o.isSaveRequest?l.saveRequestWithModel:l.getRequestWithModel),l[t]=angular.bind(l,a,o)})}return e.$inject=["baseRoute","httpParamSerializerJQLikeMode","endpointConfig","$httpParamSerializerJQLike","$injector","$resource","$q","CacheFactory"],a(e,[{key:"instantiateModel",value:function(e){var t=this.config.modelClass?new this.config.modelClass(e):e;return t&&angular.isFunction(t.afterLoad)&&t.afterLoad(),t}},{key:"request",value:function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r=!1;(this.httpParamSerializerJQLikeMode&&e.httpParamSerializerJQLikeMode!==!1||e.httpParamSerializerJQLikeMode)&&(a=this.$httpParamSerializerJQLike(a)),this.config.actions[e.name].transformResponse=function(t,n){return e.headersForReading&&Array.isArray(e.headersForReading)&&!function(){var t=n();r={},e.headersForReading.map(function(e){t[e]&&(r[e]=t[e])})}(),e.instantiateModel&&t?angular.fromJson(t):{data:t}};var i=!1,o=angular.isString(this.config.actions[e.name].cache)?this.config.actions[e.name].cache:!1;o&&(n.force&&(this.CacheFactory.destroy(o),delete n.force),this.cacher=this.CacheFactory.get(o)||this.CacheFactory.createCache(o,{storageMode:"localStorage"}),i=this.cacher.get(JSON.stringify(Object.assign({},e.name,n,a))));var u=i?new Promise(function(e){return e(i)}):this.resource[e.name](n,a).$promise;return u.then(function(i){var o=null;return o=e.instantiateModel?angular.isArray(i)?i.map(function(e){return t.instantiateModel(e)}):function(){return t.instantiateModel(i)}():i.data,o=r?[o,r]:o,t.cacher&&t.cacher.put(JSON.stringify(Object.assign({},e.name,n,a)),o),o})}},{key:"getRequestWithModel",value:function(e,t){return this.request(e,t)}},{key:"saveRequestWithModel",value:function(e,t,n){n||(n=t,t={});var a=angular.copy(n);return a&&angular.isFunction(a.beforeSave)&&a.beforeSave(),this.request(e,t,a)}}]),e}();t["default"]=r}]);
\ No newline at end of file

Fix cache issue (then after resolve promise)