UNPKG

@duoduo-oba/ng-devui

Version:

DevUI components based on Angular

122 lines (116 loc) 3.54 kB
import { Injectable, ApplicationRef, Injector, NgModule } from '@angular/core'; import { DocumentRef, WindowRef } from '@duoduo-oba/ng-devui/window-ref'; /** * @fileoverview added by tsickle * Generated from: overlay-container-ref.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class OverlayContainerRef { /** * @param {?} _appRef * @param {?} documentRef * @param {?} _injector */ constructor(_appRef, documentRef, _injector) { this._appRef = _appRef; this.documentRef = documentRef; this._injector = _injector; } /** * @param {?} viewRef * @return {?} */ insert(viewRef) { this._appRef.attachView(viewRef); this.documentRef.body.appendChild(((/** @type {?} */ (viewRef))).rootNodes[0]); return viewRef; } /** * @param {?} viewRef * @return {?} */ remove(viewRef) { viewRef.destroy(); } /** * @template C * @param {?} templateRef * @param {?=} context * @return {?} */ createEmbeddedView(templateRef, context) { /** @type {?} */ const viewRef = templateRef.createEmbeddedView(context || {}); return this.insert(viewRef); } /** * @template C * @param {?} componentFactory * @param {?=} injector * @param {?=} projectableNodes * @return {?} */ createComponent(componentFactory, injector, projectableNodes) { /** @type {?} */ const componentRef = (/** @type {?} */ (componentFactory.create(injector || this._injector, projectableNodes))); this.insert(componentRef.hostView); return componentRef; } } OverlayContainerRef.decorators = [ { type: Injectable } ]; /** @nocollapse */ OverlayContainerRef.ctorParameters = () => [ { type: ApplicationRef }, { type: DocumentRef }, { type: Injector } ]; if (false) { /** * @type {?} * @private */ OverlayContainerRef.prototype._appRef; /** * @type {?} * @private */ OverlayContainerRef.prototype.documentRef; /** * @type {?} * @private */ OverlayContainerRef.prototype._injector; } /** * @fileoverview added by tsickle * Generated from: overlay-container.module.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class OverlayContainerModule { } OverlayContainerModule.decorators = [ { type: NgModule, args: [{ imports: [], exports: [], declarations: [], providers: [ OverlayContainerRef, DocumentRef, WindowRef ], },] } ]; /** * @fileoverview added by tsickle * Generated from: public-api.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * Generated from: ng-devui-overlay-container.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ export { OverlayContainerModule, OverlayContainerRef }; //# sourceMappingURL=ng-devui-overlay-container.js.map