ng-decorators-utils
Version:
AngularJS utilities using decorators
1 lines • 3.64 kB
JavaScript
!function(r,t){for(var e in t)r[e]=t[e]}(exports,function(r){function t(n){if(e[n])return e[n].exports;var o=e[n]={exports:{},id:n,loaded:!1};return r[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var e={};return t.m=r,t.c=e,t.p="",t(0)}([function(r,t){"use strict";function e(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function n(r,t){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?r:t}function o(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(r,t):r.__proto__=t)}function i(){for(var r=arguments.length,t=Array(r),i=0;i<r;i++)t[i]=arguments[i];return function(r){return function(r){function i(){var r;e(this,i);for(var o=arguments.length,a=Array(o),u=0;u<o;u++)a[u]=arguments[u];var f=n(this,(r=i.__proto__||Object.getPrototypeOf(i)).call.apply(r,[this].concat(a))),c=0,l=!0,y=!1,s=void 0;try{for(var p,v=a[Symbol.iterator]();!(l=(p=v.next()).done);l=!0){var h=p.value;f[t[c++]]=h}}catch(r){y=!0,s=r}finally{try{!l&&v.return&&v.return()}finally{if(y)throw s}}return f}return o(i,r),f(i,null,[{key:"$inject",get:function(){return t}}]),i}(r)}}function a(r){function t(r,t,e){if(r["$"+t]instanceof Array&&e instanceof Array)for(var n=0,o=Math.max(r["$"+t].length,e.length);n<o;n++)e[n]?r["$"+t][n]=e[n]:r["$"+t].splice(n,1);else if(r["$"+t]instanceof Object&&e instanceof Object){for(var i in e)e.hasOwnProperty(i)&&(r["$"+t][i]=e[i]);for(var a in r["$"+t])r["$"+t].hasOwnProperty(a)&&!e.hasOwnProperty(a)&&delete r["$"+t][a]}else r["$"+t]=e;return e}return function(e,n){var o=e[n];return e[n]=function(){var n=o.apply(this,arguments);return n instanceof Promise||(e["$"+r]=n),n instanceof Promise?n.then(function(n){return t(e,r,n)}):t(e,r,n)},e[r]=function(){return e["$"+r]},e}}function u(){for(var r={},t=arguments.length,i=Array(t),a=0;a<t;a++)i[a]=arguments[a];var u=!0,c=!1,l=void 0;try{for(var y,s=i[Symbol.iterator]();!(u=(y=s.next()).done);u=!0){var p=y.value;r[p]=[]}}catch(r){c=!0,l=r}finally{try{!u&&s.return&&s.return()}finally{if(c)throw l}}return function(t){return function(t){function i(){return e(this,i),n(this,(i.__proto__||Object.getPrototypeOf(i)).apply(this,arguments))}return o(i,t),f(i,[{key:"on",value:function(t,e){var n=!0,o=!1,i=void 0;try{for(var a,u=t.split("|")[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var f=a.value;r[f].push(e)}}catch(r){o=!0,i=r}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}return function(){var n=!0,o=!1,i=void 0;try{for(var a,u=t.split("|")[Symbol.iterator]();!(n=(a=u.next()).done);n=!0)for(var f=a.value,c=0,l=r[f].length;c<l;c++)if(r[f][c]===e){r[f].splice(c,1);break}}catch(r){o=!0,i=r}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}}}},{key:"when",value:function(r,t){var e=this.on(r,function(){t.apply(void 0,arguments),e()});return e}},{key:"emit",value:function(t){for(var e=0,n=r[t].length,o=arguments.length,i=Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];for(;e<n;){var u;(u=r[t])[e++].apply(u,i)}}}]),i}(t)}}Object.defineProperty(t,"__esModule",{value:!0});var f=function(){function r(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}return function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}}();t.Inject=i,t.Memoize=a,t.EventEmitter=u}]));