Member Junction
    Preparing search index...

    Directive that exposes a ViewContainerRef for dynamic component loading. This is used to create a reference point for dynamically loading components into the DOM without manually handling ViewContainerRef injection.

    <!-- In template -->
    <div mjContainer></div>

    <!-- In component -->
    @ViewChild(Container, { static: true }) container!: Container;
    // Now you can use this.container.viewContainerRef for dynamic component creation
    Index

    Constructors

    Properties

    Constructors

    • Constructor that exposes the ViewContainerRef for the element

      Parameters

      • viewContainerRef: ViewContainerRef

        The ViewContainerRef for the element this directive is applied to

      Returns Container

    Properties

    viewContainerRef: ViewContainerRef

    The ViewContainerRef for the element this directive is applied to