-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular-ts-decorators.umd.min.js
1 lines (1 loc) · 5.88 KB
/
angular-ts-decorators.umd.min.js
1
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("angular"),require("tslib"),require("reflect-metadata")):"function"==typeof define&&define.amd?define(["exports","angular","tslib","reflect-metadata"],n):n(t["angular-ts-decorators"]=t["angular-ts-decorators"]||{},t.angular,t.tslib)}(this,function(t,n,e){"use strict";function o(t){return n.injector().annotate(t)}function r(t){return t.replace(/(-\w)/g,function(t){return t[1].toUpperCase()})}function i(t){return t.substr(1,t.length-2)}function c(t){return/^[\[].*[\]]$/g.test(t)}function a(t,n){return Reflect.getMetadata(t,n)}function s(t,n,e){Reflect.defineMetadata(t,n,e)}function u(t,n){var e=a(j.name,n),r=a(j.options,n),i=a(j.listeners,r.controller);i&&(r.controller=f(r.controller,i)),n.$inject=n.$inject||o(n),t.component(e,r)}function f(t,n){var o=Object.keys(n),r=function(t){function r(n){for(var e=[],o=1;o<arguments.length;o++)e[o-1]=arguments[o];var r=t.apply(this,e)||this;return r.$element=n,r}return e.__extends(r,t),r.prototype.$postLink=function(){var e=this;t.prototype.$postLink&&t.prototype.$postLink.call(this),o.forEach(function(t){var o=n[t].eventName;e.$element.on(o,e[t].bind(e))})},r.prototype.$onDestroy=function(){var e=this;t.prototype.$onDestroy&&t.prototype.$onDestroy.call(this),o.forEach(function(t){var o=n[t].eventName;e.$element.off(o,e[t])})},r}(t);return r.$inject=["$element"].concat(t.$inject||[]),r}function l(t){var n=t.prototype;p(n).forEach(function(t){var e=C[t];n[e]=n[t],delete n[t]})}function p(t){return Object.keys(C).filter(function(e){return n.isFunction(t[e])})}function d(t,n){var e,r=a(j.name,n),i=a(j.options,n),c=n.prototype,s=c.compile,u=c.link;if(s&&"function"==typeof s||u&&"function"==typeof u)(e=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var o=t[0].instantiate(n);return s?i.compile=s.bind(o):u&&(i.link=u.bind(o)),i}).$inject=["$injector"].concat(n.$inject||o(n));else{n.$inject=n.$inject||o(n),l(n);var f=a(j.listeners,n);i.controller=f?v(n,f):n,e=function(){return i}}t.directive(r,e)}function v(t,n){var o=Object.keys(n),r=function(t){function r(n){for(var e=[],o=1;o<arguments.length;o++)e[o-1]=arguments[o];var r=t.apply(this,e)||this;return r.$element=n,r}return e.__extends(r,t),r.prototype.$postLink=function(){var e=this;t.prototype.$postLink&&t.prototype.$postLink.call(this),o.forEach(function(t){var o=n[t].eventName;e.$element.on(o,e[t].bind(e))})},r.prototype.$onDestroy=function(){var e=this;t.prototype.$onDestroy&&t.prototype.$onDestroy.call(this),o.forEach(function(t){var o=n[t].eventName;e.$element.off(o,e[t])})},r}(t);return r.$inject=["$element"].concat(t.$inject||[]),r}function m(t,n){n.forEach(function(n){if(n.provide){var e=n.provide;n.useClass&&n.useClass instanceof Function?(n.useClass.$inject=n.useClass.$inject||o(n.useClass),n.useClass.prototype.$get?t.provider(e,n.useClass):t.service(e,n.useClass)):n.useFactory&&n.useFactory instanceof Function?(n.useFactory.$inject=n.useFactory.$inject||o(n.useFactory),t.factory(e,n.useFactory)):n.useValue&&t.constant(e,n.useValue)}else{var r=a(j.name,n);n.$inject=n.$inject||o(n),n.prototype.$get?t.provider(r,n):t.service(r,n)}})}function $(t,n){var e=a(j.name,n),r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var o=t[0].instantiate(n);return o.transform.bind(o)};r.$inject=["$injector"].concat(n.$inject||o(n)),t.filter(e,r)}function y(t,n,e,o){var r=t.constructor,i=a(j.bindings,r)||{};i[n]=o||e,s(j.bindings,i,r)}function g(t){var e=t.id,r=t.name,i=t.declarations,c=void 0===i?[]:i,s=t.imports,f=void 0===s?[]:s,l=t.providers,p=void 0===l?[]:l;return function(t){var i=f.map(function(t){return"string"==typeof t?t:t.module.name});r&&(e=r),e||(e=t.name);var s=n.module(e,i);c.forEach(function(t){switch(a(j.declaration,t)){case h.component:u(s,t);break;case h.directive:d(s,t);break;case h.pipe:$(s,t)}}),p&&m(s,p);var l=t.config,v=t.run;l&&(l.$inject=o(l),s.config(l)),v&&(v.$inject=o(v),s.run(v)),t.module=s}}var h,b={bootstrapModule:function(t,e){var o=!0;e&&(o=e.strictDi),n.element(document).ready(function(){n.bootstrap(document,[t.module.name],{strictDi:o})})}};!function(t){t[t.component=0]="component",t[t.directive=1]="directive",t[t.pipe=2]="pipe"}(h||(h={}));var j={declaration:"custom:declaration",name:"custom:name",bindings:"custom:bindings",options:"custom:options",listeners:"custom:listeners"},C={ngOnInit:"$onInit",ngOnDestroy:"$onDestroy",ngDoCheck:"$doCheck",ngOnChanges:"$onChanges",ngAfterViewInit:"$postLink"},k=function(){function t(t,n,e){this.previousValue=t,this.currentValue=n,this.firstChange=e}return t.prototype.isFirstChange=function(){return this.firstChange},t}();t.platformBrowserDynamic=function(){return b},t.Component=function(t){var n=t.selector,o=e.__rest(t,["selector"]);return function(t){o.controller=t;var e=c(n),u=a(j.bindings,t);u&&(e?(o.bindToController=u,o.controllerAs=o.controllerAs||"$ctrl"):o.bindings=u),e&&(o.restrict="A"),l(t);var f=e?i(n):n;s(j.name,r(f),t),s(j.declaration,e?h.directive:h.component,t),s(j.options,o,t)}},t.Directive=function(t){var n=t.selector,o=e.__rest(t,["selector"]);return function(t){var e=a(j.bindings,t);e&&(o.bindToController=e),o.restrict=o.restrict||"A",o.restrict,o.link||o.compile;var u=c(n)?i(n):n;s(j.name,r(u),t),s(j.declaration,h.directive,t),s(j.options,o,t)}},t.Injectable=function(t){return function(n){t||(t=n.name),s(j.name,t,n)}},t.Pipe=function(t){return function(n){s(j.name,t.name,n),s(j.declaration,h.pipe,n)}},t.Input=function(t){return function(n,e){return y(n,e,"<",t)}},t.Output=function(t){return function(n,e){return y(n,e,"&",t)}},t.NgModule=g,t.NgModuleDecorated=g,t.HostListener=function(t,n){return function(e,o,r){var i=r.value;if("function"!=typeof i)throw new Error("@HostListener decorator can only be applied to methods not: "+typeof i);var c=e.constructor,u=a(j.listeners,c)||{};u[o]={eventName:t,args:n},s(j.listeners,u,c)}},t.ngLifecycleHooksMap=C,t.SimpleChange=k,Object.defineProperty(t,"__esModule",{value:!0})});