@duoduo-oba/ng-devui
Version:
DevUI components based on Angular
2 lines • 1.67 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("lodash-es"),require("@angular/common")):"function"==typeof define&&define.amd?define("ng-devui/portal",["exports","@angular/core","lodash-es","@angular/common"],t):t(((e=e||self)["ng-devui"]=e["ng-devui"]||{},e["ng-devui"].portal={}),e.ng.core,e.lodashEs,e.ng.common)}(this,(function(e,t,o,n){"use strict";var r=function(){function e(e){this.appRef=e}return e.prototype.addContent=function(){var e=this;this.portalContainer=document.createElement("div"),this.viewRef=this.templateRef.createEmbeddedView(this),o.forEach(this.viewRef.rootNodes,(function(t){e.portalContainer.appendChild(t)})),this.appRef.attachView(this.viewRef),document.body.appendChild(this.portalContainer)},e.prototype.open=function(){this.close(),this.addContent()},e.prototype.close=function(){this.viewRef&&this.portalContainer&&(document.body.removeChild(this.portalContainer),this.viewRef.destroy(),this.viewRef=null,this.portalContainer=null)},e.decorators=[{type:t.Component,args:[{selector:"d-portal",template:"\n <ng-template #templateRef>\n <ng-content></ng-content>\n </ng-template>"}]}],e.ctorParameters=function(){return[{type:t.ApplicationRef}]},e.propDecorators={templateRef:[{type:t.ViewChild,args:["templateRef",{static:!0}]}]},e}();var i=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[r],exports:[r]}]}],e}();e.PortalComponent=r,e.PortalModule=i,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=ng-devui-portal.umd.min.js.map