Created
September 2, 2022 17:38
-
-
Save fireflysemantics/1b20985300b4e03e3171914e5f6fc240 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Directive({ selector: '[isReady]' }) | |
export class ReadyDirective implements OnInit { | |
@Input('isReady') isReady: boolean; | |
constructor( | |
private templateRef: TemplateRef<void>, | |
private vcr: ViewContainerRef | |
) {} | |
ngOnInit() { | |
if (this.isReady) { | |
this.vcr.createEmbeddedView(this.templateRef); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment