UNPKG

@anglr/grid

Version:
31 lines 1.75 kB
import { ViewContainerRef, ViewChild, inject, Directive } from '@angular/core'; import { CONTENT_RENDERER_CURRENT_VIEW_CONTAINER } from '../../misc/tokens'; import * as i0 from "@angular/core"; /** * Base class for all renderable content components */ export class RenderableContentComponent { constructor() { //######################### protected fields ######################### /** * Instance of class that is used for sharing content renderers current view container */ this.currentViewContainer = inject(CONTENT_RENDERER_CURRENT_VIEW_CONTAINER); } //######################### public methods - implementation of OnInit ######################### /** * Initialize component */ ngOnInit() { this.currentViewContainer.viewContainer = this.viewContainer; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: RenderableContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0", type: RenderableContentComponent, isStandalone: true, viewQueries: [{ propertyName: "viewContainer", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: RenderableContentComponent, decorators: [{ type: Directive }], propDecorators: { viewContainer: [{ type: ViewChild, args: ['container', { static: true, read: ViewContainerRef }] }] } }); //# sourceMappingURL=renderableContent.component.js.map