Class

ModelRendererComponent

ModelRendererComponent(injector)

Constructor

# 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

sequenceDiagram participant App participant ModelRenderer participant RenderingEngine participant Model App->>ModelRenderer: Input model ModelRenderer->>Model: Parse if string Model-->>ModelRenderer: Parsed model ModelRenderer->>RenderingEngine: Render model RenderingEngine-->>ModelRenderer: Rendered output ModelRenderer->>ModelRenderer: Subscribe to events ModelRenderer-->>App: Emit events
Parameters:
Name Type Description
injector Injector

Angular Injector for dependency injection

View Source lib/components/model-renderer/model-renderer.component.ts, line 42

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

View Source lib/components/model-renderer/model-renderer.component.ts, line 51

Record.<string, unknown>

# globals

Global variables to be passed to the rendered component

.

Global variables to be passed to the rendered component

View Source lib/components/model-renderer/model-renderer.component.ts, line 195

# inner

Template reference for inner content

.

Template reference for inner content

View Source lib/components/model-renderer/model-renderer.component.ts, line 55

TemplateRef.<unknown>

# inner

Template reference for inner content

.

Template reference for inner content

View Source lib/components/model-renderer/model-renderer.component.ts, line 200

# instance

Instance of the rendered component

.

Instance of the rendered component

View Source lib/components/model-renderer/model-renderer.component.ts, line 75

# listenEvent

Event emitter for custom events from the rendered component

.

Event emitter for custom events from the rendered component

View Source lib/components/model-renderer/model-renderer.component.ts, line 71

# listenEvent

Event emitter for custom events from the rendered component

.

Event emitter for custom events from the rendered component

View Source lib/components/model-renderer/model-renderer.component.ts, line 219

# model

Can be a Model instance or a JSON string representation of a model

Input model to be rendered

View Source lib/components/model-renderer/model-renderer.component.ts, line 47

M | string | undefined

# model

Can be a Model instance or a JSON string representation of a model

Input model to be rendered

View Source lib/components/model-renderer/model-renderer.component.ts, line 190

# output

Output of the rendered model

.

Output of the rendered model

View Source lib/components/model-renderer/model-renderer.component.ts, line 59

AngularDynamicOutput

# output

Output of the rendered model

.

Output of the rendered model

View Source lib/components/model-renderer/model-renderer.component.ts, line 205

# rendererId

Unique identifier for the renderer

.

Unique identifier for the renderer

View Source lib/components/model-renderer/model-renderer.component.ts, line 63

string

# rendererId

Unique identifier for the renderer

.

Unique identifier for the renderer

View Source lib/components/model-renderer/model-renderer.component.ts, line 210

# vcr

View container reference for dynamic component rendering

.

View container reference for dynamic component rendering

View Source lib/components/model-renderer/model-renderer.component.ts, line 67

ViewContainerRef

# vcr

View container reference for dynamic component rendering

.

View container reference for dynamic component rendering

View Source lib/components/model-renderer/model-renderer.component.ts, line 215

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

View Source lib/components/model-renderer/model-renderer.component.ts, line 239

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

View Source lib/components/model-renderer/model-renderer.component.ts, line 246

Promise.<void>

# refresh(model)

Refreshes the rendered model

.

Refreshes the rendered model

Parameters:
Name Type Description
model string | M

The model to be rendered

View Source lib/components/model-renderer/model-renderer.component.ts, line 82

# unsubscribeEvents()

Unsubscribes from events emitted by the rendered component

.

Unsubscribes from events emitted by the rendered component

View Source lib/components/model-renderer/model-renderer.component.ts, line 134