import { Directive , Input } from "@angular/core" ; import { TemplateRef , ViewContainerRef } from "@angular/core" ; @ Directive ( { selector : "[sdkUnless]" } ) export class UnlessDirective { constructor ( private templateRef , private container ) { } @ Input ( ) set sdkUnless ( condition ) { if ( ! condition ) { this . container . createEmbeddedView ( this . templateRef ) ; } else { this . container . clear ( ) ; } } }