UNPKG

ngx-dynamic-compiler

Version:

2 lines 2.59 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core"),require("@angular/platform-browser-dynamic")):"function"==typeof define&&define.amd?define("ngx-dynamic-compiler",["exports","@angular/common","@angular/core","@angular/platform-browser-dynamic"],t):t(e["ngx-dynamic-compiler"]={},e.ng.common,e.ng.core,e.ng.platformBrowserDynamic)}(this,function(e,s,l,t){"use strict";var o=(n.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],n.ctorParameters=function(){return[]},n.ngInjectableDef=l.defineInjectable({factory:function(){return new n},token:n,providedIn:"root"}),n);function n(){}var r=(i.prototype.ngOnInit=function(){this.compileTemplate(this.Data)},i.prototype.ngOnChanges=function(){},i.prototype.compileTemplate=function(e){var t={template:this.Template,selector:"ptv-template"},o=this.createComponentFactorySync(this.compiler,t,null,e);this.componentRef&&(this.componentRef.destroy(),this.componentRef=null),this.componentRef=this.container.createComponent(o)},i.prototype.createComponentFactorySync=function(e,t,o,n){var r=o||function m(){this.Data=n},i=l.Component(t)(r),a=(p.decorators=[{type:l.NgModule,args:[{imports:[s.CommonModule],declarations:[i]}]}],p);function p(){}var c=e.compileModuleAndAllComponentsSync(a);return console.log(JSON.stringify(c.componentFactories)),c.componentFactories.find(function(e){return e.componentType==i})},i.prototype.ngOnDestroy=function(){this.componentRef&&(this.componentRef.destroy(),this.componentRef=null)},i.decorators=[{type:l.Component,args:[{selector:"ngx-dc",template:"\n <div #container>\n\n </div>\n "}]}],i.ctorParameters=function(){return[{type:l.Compiler}]},i.propDecorators={container:[{type:l.ViewChild,args:["container",{read:l.ViewContainerRef}]}],Data:[{type:l.Input}],Template:[{type:l.Input}],Output:[{type:l.Output}]},i);function i(e){this.compiler=e,this.Data={},this.Template="",this.Output=new l.EventEmitter,this.html="",this.returnUrl="/",this.showFilter=!0}function a(e){return e.createCompiler()}var p={},c=(m.decorators=[{type:l.NgModule,args:[{declarations:[r],imports:[],providers:[{provide:l.COMPILER_OPTIONS,useValue:p,multi:!0},{provide:l.CompilerFactory,useClass:t.JitCompilerFactory,deps:[l.COMPILER_OPTIONS]},{provide:l.Compiler,useFactory:a,deps:[l.CompilerFactory]}],exports:[r]}]}],m);function m(){}e.NgxDynamicCompilerService=o,e.NgxDynamicCompilerComponent=r,e.createCompiler=a,e.NgxDCModule=c,Object.defineProperty(e,"__esModule",{value:!0})}); //# sourceMappingURL=ngx-dynamic-compiler.umd.min.js.map