import { ComponentRegistration } from '@daffodil/content'
Registers an Angular component for use in the content schema renderer. Components must be registered before they can be referenced by name in a schema.
interface ComponentRegistration {
componentType: Type<any>
name: string
description: string
children: ComponentRegistration[]
}
componentType Type |
|---|
The Angular component class to register. |
name string |
|---|
The unique name used to reference this component in the schema. |
description string |
|---|
An optional description of the component for documentation purposes. |
children ComponentRegistration[] |
|---|
Optional nested component registrations for grouping related components. |
const buttonRegistration: ComponentRegistration = {
componentType: DaffButtonComponent,
name: 'DaffButtonComponent',
description: 'A styled button component',
};
const buttonRegistration: ComponentRegistration = {
componentType: DaffButtonComponent,
name: 'DaffButtonComponent',
description: 'A styled button component',
};