core/dynamic-component/dynamic-component.model.ts
A dynamic component can be defined in a the HOOK_COMPONENTS to display any kind
of component dynamically just by referencing it's id. The most common use case is on dashboards,
where the configComponent
is used to define what is displayed on the component
on the dashboard.
To use the component you can use the c8y-dynamic-component.
* <c8y-dynamic-component
* componentId="angular.widget.demo"
* [config]="{ text: 'Hello world' }"
* [mode]="editComponent ? 'config' : 'component'"
* ></c8y-dynamic-component>
*
Properties |
|
component |
component:
|
Type : Type<Component>
|
The component which is used when the component should be displayed (e.g. on a dashboard) |
configComponent |
configComponent:
|
Type : Type<Component>
|
Optional |
The configuration component used when a widget is added or edited. |
data |
data:
|
Type : any
|
Optional |
Add any random data, specially to angular.js dashboards. Should be searilzabled to allow to save it to the API. |
description |
description:
|
Type : string
|
The description shown on add widget |
id |
id:
|
Type : string
|
Unique serializable id |
label |
label:
|
Type : string
|
The label shown for this dynamic component on add widgets |
previewImage |
previewImage:
|
Type : string
|
Optional |
An url to an preview image. |