# new ModelRendererComponent(injector)
This component is responsible for dynamically rendering models, handling model changes, and managing event subscriptions for the rendered components. It uses the NgxRenderingEngine to render the models and supports both string and Model inputs.
Component for rendering dynamic models
Parameters:
Name | Type | Description |
---|---|---|
injector |
Injector
|
Angular Injector for dependency injection |
Example
<ngx-decaf-model-renderer
[model]="myModel"
[globals]="globalVariables"
(listenEvent)="handleEvent($event)">
</ngx-decaf-model-renderer>
Members
# globals
Global variables to be passed to the rendered component
.Global variables to be passed to the rendered component
Record.<string, unknown>
# globals
Global variables to be passed to the rendered component
.Global variables to be passed to the rendered component
TemplateRef.<unknown>
# inner
Template reference for inner content
.Template reference for inner content
# listenEvent
Event emitter for custom events from the rendered component
.Event emitter for custom events from the rendered component
# listenEvent
Event emitter for custom events from the rendered component
.Event emitter for custom events from the rendered component
# model
Can be a Model instance or a JSON string representation of a model
Input model to be rendered
M
|
string
|
undefined
# model
Can be a Model instance or a JSON string representation of a model
Input model to be rendered
# vcr
View container reference for dynamic component rendering
.View container reference for dynamic component rendering
ViewContainerRef
# vcr
View container reference for dynamic component rendering
.View container reference for dynamic component rendering
Methods
# ngOnChanges(changes) → {void}
Lifecycle hook that is called when data-bound properties of a directive change
.Lifecycle hook that is called when data-bound properties of a directive change
Parameters:
Name | Type | Description |
---|---|---|
changes |
SimpleChanges
|
Object containing changes |
void
# async ngOnDestroy() → {Promise.<void>}
Lifecycle hook that is called when a directive, pipe, or service is destroyed
.Lifecycle hook that is called when a directive, pipe, or service is destroyed
Promise.<void>
# refresh(model)
Refreshes the rendered model
.Refreshes the rendered model
Parameters:
Name | Type | Description |
---|---|---|
model |
string
|
M
|
The model to be rendered |
# unsubscribeEvents()
Unsubscribes from events emitted by the rendered component
.Unsubscribes from events emitted by the rendered component