provideDynamicForm
| Generic types: | T |
Provider function to configure the dynamic form system with field types and options.
This function creates environment providers that can be used at application or route level to register field types. It provides type-safe field registration with automatic type inference.
Presentation
function provideDynamicForm (
items: T,
): ProvideDynamicFormResult<
ExtractFieldTypes<T> extends FieldTypeDefinition <any>[]
? ExtractFieldTypes<T>
: FieldTypeDefinition <any>[]
>;Returns
ProvideDynamicFormResult<ExtractFieldTypes<T> extends FieldTypeDefinition <any>[] ? ExtractFieldTypes<T> : FieldTypeDefinition <any>[]> -Environment providers for dependency injection with type inference
Parameters
| Name | Type | Description |
|---|---|---|
| items | T | Field type definitions and/or features (like withLoggerConfig) |
Example usage
// Application-level setup
bootstrapApplication(AppComponent, {
providers: [
provideDynamicForm (...withMaterialFields ())
]
});// Disable logging
bootstrapApplication(AppComponent, {
providers: [
provideDynamicForm (
...withMaterialFields (),
withLoggerConfig (false)
)
]
});// Custom field types with type inference
import { CustomFieldType, AnotherFieldType } from './custom-fields';
export const appConfig: ApplicationConfig = {
providers: [
provideDynamicForm (CustomFieldType, AnotherFieldType)
]
};