UNPKG

@taiga-ui/cdk

Version:

Base library for creating Angular components and applications using Taiga UI principles regarding of actual visual appearance

55 lines (50 loc) 2.02 kB
import * as i0 from '@angular/core'; import { inject, ViewContainerRef, TemplateRef, Directive, Input } from '@angular/core'; /** * @internal */ class TuiLetContext { constructor(internalDirectiveInstance) { this.internalDirectiveInstance = internalDirectiveInstance; } get $implicit() { return this.internalDirectiveInstance.tuiLet; } get tuiLet() { return this.internalDirectiveInstance.tuiLet; } } /** * Works like *ngIf but does not have a condition — use it to declare * the result of pipes calculation (i.e. async pipe) */ class TuiLet { constructor() { inject(ViewContainerRef).createEmbeddedView(inject((TemplateRef)), new TuiLetContext(this)); } /** * Asserts the correct type of the context for the template that `TuiLet` will render. * * The presence of this method is a signal to the Ivy template type-check compiler that the * `TuiLet` structural directive renders its template with a specific context type. */ static ngTemplateContextGuard(_dir, _ctx) { return true; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiLet, deps: [], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiLet, isStandalone: true, selector: "[tuiLet]", inputs: { tuiLet: "tuiLet" }, ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiLet, decorators: [{ type: Directive, args: [{ standalone: true, selector: '[tuiLet]', }] }], ctorParameters: function () { return []; }, propDecorators: { tuiLet: [{ type: Input }] } }); /** * Generated bundle index. Do not edit. */ export { TuiLet, TuiLetContext }; //# sourceMappingURL=taiga-ui-cdk-directives-let.mjs.map