import { Directive , Inject , Input , TemplateRef , ViewContainerRef } from '@angular/core' ; import type { NzSafeAny } from 'ng-zorro-antd/core/types' ; export class LetContext < T > { constructor ( private readonly dir ) { } get $implicit ( ) : T { return this . dir . let ; } get let ( ) : T { return this . dir . let ; } } @ Directive ( { selector : '[let]' } ) export class LetDirective < T > { @ Input ( ) let ! : T ; constructor ( @ Inject ( ViewContainerRef ) vc , @ Inject ( TemplateRef ) ref ) { vc . createEmbeddedView ( ref , new LetContext < T > ( this ) ) ; } static ngTemplateContextGuard < T > ( _dir , _ctx ) { return true ; } }