Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SfDynamicComponentLoaderComponent

API reference for SfDynamicComponentLoaderComponent

import {SfDynamicComponentLoaderModule} from "@progress/sitefinity-component-framework";


selector: sf-component-loader Description: Instantiates components or embedded views dynamically

Hierarchy

  • SfDynamicComponentLoaderComponent

Implements

  • OnChanges
  • OnInit
  • OnDestroy

Index

Constructors

constructor

  • Parameters

    • resolver: ComponentFactoryResolver
    • renderer: Renderer2

    Returns SfDynamicComponentLoaderComponent

Properties

Private _componentInstance$

_componentInstance$: BehaviorSubject<any> = new BehaviorSubject<any>(null)

Emits the component instance

Private _embeddedViewRef

_embeddedViewRef: EmbeddedViewRef<any>

A reference to the created embedded view

Private componentCache

componentCache: Map<ComponentData, ComponentRef<any>> = new Map<ComponentData, ComponentRef<any>>()

Stores the component once it is instantiated

componentData

componentData: ComponentData

Used by SfDynamicComponentLoader to get necessary data for dynamic component instantiation.

componentInit

componentInit: EventEmitter<any>

Emitted when the dynamic component is instantiated

Private renderer

renderer: Renderer2

Private resolver

resolver: ComponentFactoryResolver

templateData

templateData: TemplateData

Used by SfDynamicComponentLoader to get necessary data for the template instantiation.

viewContainer

viewContainer: ViewContainerRef

The container in which the component will be instantiated

Accessors

currentInstance

  • get currentInstance(): any
  • Gets the component instance

    Returns any

instance$

  • get instance$(): Observable<any>
  • Gets the component instance as an observable

    Returns Observable<any>

Methods

destroy

  • Parameters

    Returns void

Private handleComponentDataChange

  • handleComponentDataChange(componentDataChange: SimpleChange): void
  • Reinitialize the component after componentData is changed and if updatePropertiesOnChange is true

    Parameters

    • componentDataChange: SimpleChange

    Returns void

Private handleTemplateDataChange

  • handleTemplateDataChange(templateDataChange: SimpleChange): void
  • Parameters

    • templateDataChange: SimpleChange

    Returns void

Private initComponent

  • Dynamically create the component its ComponentFactory and set its properties Saves the component in the cache object for quick retrieval

    Parameters

    Returns void

Private initEmbeddedView

  • Creates embedded view from templateData

    Parameters

    Returns void

ngOnChanges

  • ngOnChanges(changes: SimpleChanges): void
  • Parameters

    • changes: SimpleChanges

    Returns void

ngOnDestroy

  • ngOnDestroy(): void
  • Returns void

ngOnInit

  • ngOnInit(): void
  • Returns void

Private setProperties

  • setProperties(componentData: ComponentData, componentInstance: any): void
  • Set the properties of the component

    Parameters

    Returns void

Generated using TypeDoc