Function
createWrappers
@ng-forge/dynamic-forms
Bundle wrapper registrations into a single object that can be passed to
provideDynamicForm(...).
Signature
function createWrappers<
const T extends readonly WrapperRegistration[]
>(registrations?: T): WrappersBundle<T>Type Parameters
| Name | Constraint | Default | Description |
|---|---|---|---|
T | readonly WrapperRegistration[] | - | - |
Parameters
| Name | Type | Description |
|---|---|---|
registrations? | T | - |
Returns
Examples
const appWrappers = createWrappers(
{
wrapperName: 'section',
loadComponent: () => import('./section-wrapper'),
props: wrapperProps<SectionWrapper>(),
},
{
wrapperName: 'highlight',
loadComponent: () => import('./highlight-wrapper'),
types: ['input', 'select'],
props: wrapperProps<HighlightWrapper>(),
},
);
declare module '@ng-forge/dynamic-forms' {
interface FieldRegistryWrappers extends InferWrapperRegistry<typeof appWrappers> {}
}
bootstrapApplication(AppComponent, {
providers: [provideDynamicForm(appWrappers)],
});packages/dynamic-forms/src/lib/wrappers/create-wrappers.ts:67