Skip to content

Instantly share code, notes, and snippets.

@MarkTechson
Created November 3, 2021 03:08
New API to dynamically create components
@Directive({ … })
export class MyDirective {
constructor(private viewContainerRef: ViewContainerRef) {}
createMyComponent() {
this.viewContainerRef.createComponent(MyComponent);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment