Skip to content

laudebugs/dynamic-components-angular

Repository files navigation

Dynamic Components in Angular

A repository to demonstrate the use of dynamic components in Angular

Read referenced article here Stackblitz

Glossary

ViewContainerRef

A reference to the container where one or more views can be attached. Reference

@ViewChild

A property decorator that configures a view query. Reference

Directives

movieHost

Directive to anchor where to host the dynamic component.

import { Directive, ViewContainerRef } from '@angular/core'

@Directive({ selector: '[movieHost]' })
export class MovieHostDirective {
    constructor(private viewContainerRef: ViewContainerRef) {}
}