Skip to content

Instantly share code, notes, and snippets.

@fireflysemantics
Created September 2, 2022 17:38
Show Gist options
  • Save fireflysemantics/1b20985300b4e03e3171914e5f6fc240 to your computer and use it in GitHub Desktop.
Save fireflysemantics/1b20985300b4e03e3171914e5f6fc240 to your computer and use it in GitHub Desktop.
@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