API Reference
Browse the public API surface of ng-forge packages
Core @ng-forge/dynamic-forms
Components 4
Container component for rendering dynamic arrays of fields. Supports add/remove/move operations via the arrayEvent() bu...
Layout container that wraps child fields with UI chrome. Resolves children like a row, then chains wrapper components a...
Dynamic form component — renders a form based on configuration. Delegates state management to `FormStateManager`.
Container component for rendering nested form groups. Creates a scoped form context with its own validation state. Chil...
Injectables 2
Classes 17
Event dispatched to append a new item at the END of an array field. This is the most common array operation - adding it...
Console-based logger implementation.
Base error class for all Dynamic Forms errors. This class centralizes the `[Dynamic Forms]` prefix, ensuring consistent...
Event dispatched when the form should be cleared. This event instructs the dynamic form component to clear all field va...
Event dispatched when the form should be reset to its default values. This event instructs the dynamic form component t...
Event dispatched to insert a new item at a SPECIFIC INDEX in an array field. Use this when you need precise control ove...
Event dispatched to move an existing item from one index to another within an array field. This is an atomic reorder op...
No-operation logger implementation. All methods are no-ops - used in production by default.
Event dispatched to remove the LAST item from an array field. Equivalent to JavaScript's `Array.pop()` - removes from t...
Event dispatched to prepend a new item at the BEGINNING of an array field. Use this when new items should appear at the...
Event dispatched to remove an item at a SPECIFIC INDEX from an array field. Use this when you need precise control over...
Registry service that provides access to the root form and its values. Constructed via factory in `provideDynamicFormDI...
Event dispatched to remove the FIRST item from an array field. Equivalent to JavaScript's `Array.shift()` - removes fro...
Interfaces 59
Configuration for auto-generated add/remove buttons in simplified array fields.
Array context for fields rendered within arrays. Provides position and parent array information for components inside ar...
Array field interface for creating dynamic field collections that map to array values. Key concepts: - The outer `field...
Context object for array item operations (add/remove) Provides the necessary information to resolve tokens in array item...
Condition that evaluates based on a registered async function. The function is resolved reactively — when dependent for...
Async custom validator configuration using Angular's resource-based API Angular's validateAsync uses the resource API f...
Async custom validator configuration using Angular's validateAsync API. Returns Observable<ValidationError | ValidationE...
Base configuration shared by all validators
Built-in validator configuration (required, email, min, max, etc.)
Context for resolving button disabled state. @public
Container field interface for wrapping child fields with UI chrome. A container field is a container that renders its c...
Configuration for the built-in 'css' wrapper type. The CSS wrapper applies CSS classes around wrapped content via a Dyn...
Signal forms adapter configuration for advanced form behavior. Provides configuration options for signal forms integrat...
Custom validator configuration using Angular's public FieldContext API Returns ValidationError | ValidationError[] | nul...
Declarative HTTP validator configuration — fully JSON-serializable, no function registration required. Uses `HttpReques...
Global interface for dynamic form field definitions with categorization This interface combines containers and leaves fr...
Base interface for all dynamic form field definitions. This interface defines the common properties that all field type...
Base interface for native HTML attributes that can be passed to form field elements. This interface serves as the base ...
Container fields registry - augment this interface to add custom container fields
Leaf fields registry - augment this interface to add custom leaf fields
Wrapper type registry for module augmentation. Augment this interface to add type-safe wrapper type definitions.
Field signal context - the "nervous system" of the dynamic form. Provided via FIELD_SIGNAL_CONTEXT injection token. Giv...
Represents the state information of a single form field. Used in evaluation contexts to allow expressions and condition...
Configuration interface for registering custom field types. Defines how a field type should be handled by the dynamic f...
Contract that wrapper components must satisfy. Each wrapper exposes a `#fieldComponent` ViewContainerRef where the inne...
Configuration interface for defining dynamic form structure and behavior. This interface defines the complete form sche...
Base interface for all form events in the dynamic form system. All form events must implement this interface to be comp...
Result of form mode detection with validation details
Global form configuration options. Controls form-wide behavior including disabled state and button behavior configurati...
Group field interface for creating logical field groupings that map to object values Groups create nested form structure...
Condition that evaluates based on an HTTP response from a remote server. The HTTP request is resolved reactively — when...
HTTP-based validator configuration for Angular's validateHttp API Angular's validateHttp provides optimized HTTP valida...
Configuration for an HTTP request used by declarative HTTP validators, derivations, and conditions. All string values i...
HTTP request configuration for validateHttp API
Mapping configuration for interpreting HTTP responses as validation results. Expressions in `validWhen` and `errorParam...
Interface for dynamic forms logger implementations. Allows custom logging integrations (Sentry, DataDog, etc.)
Options for controlling next page button disabled behavior. @public
Context for resolving state (hidden/disabled) for non-form-bound elements. This is a generalized context that can be us...
Page field interface for creating top-level page layouts This is a special field type that contains other field definiti...
Read-only view of a single field's observable state. Whitelisted read signals copied from Angular Signal Forms' `FieldS...
Row field interface for creating horizontal layouts. A row is a synthetic field type that resolves to a Container at run...
Configuration for applying predefined schemas
Reusable schema definition that can be referenced by name
Simplified array field interface for common use cases. Instead of manually specifying each item in `fields`, provide a ...
Configuration for form submission handling. When provided, enables integration with Angular Signal Forms' native `submi...
Options for controlling submit button disabled behavior. @public
Text field definition for displaying translatable text content
Context for token resolution in event args
Configuration for excluding field values from form submission output based on their reactive state (hidden, disabled, re...
Input shape passed to a wrapper component via the `fieldInputs` input. Carries the wrapped field's mapper outputs plus ...
User-facing wrapper registration shape used with `createWrappers(...)`. Extends `WrapperTypeDefinition` with an optiona...
Branded bundle returned by `createWrappers(...)`. Carries: - `ɵkind: 'wrappers'` — discriminant recognised by `provideD...
Configuration interface for registering wrapper types. Defines how a wrapper component is loaded and identified. Wrappe...
Types 50
Fields that are allowed as children of Array fields Arrays can contain: rows, groups, and leaf fields (but NOT pages or ...
Type representing a FieldTree for an array. Extends FieldTree to add numeric indexing for accessing item FieldTrees.
Template type for array items used in events. Canonical definition lives in {@link ArrayItemDefinition} — this alias pre...
An array item template is an array of allowed children that defines one OBJECT array item's fields. Used for object arra...
Async function for conditions — returns boolean. The function receives the evaluation context and may return a Promise ...
Async function for derivations — returns any value. The function receives the evaluation context and may return a Promi...
Extract field types that are available in the registry
Discriminated union of all conditional expression types. Each variant only allows the properties relevant to its type, ...
Fields that are allowed as children of Container fields. Containers are pure layout primitives that flatten their childr...
Union type of all registered container field definitions
Custom validator function signature using Angular's public FieldContext API Takes FieldContext (full Angular context) a...
Extract a specific field type from RegisteredFieldTypes based on the `type` discriminant. This enables proper type narro...
Extract FieldDef types from provider result
Extract form value type from provider result
Type utility for extracting component input properties from field definitions. Transforms field definition properties i...
Type helper for accessing nested field paths safely This allows accessing child paths while maintaining some type safety
Semantic grouping of interchangeable field UI alternatives. Used by tooling (e.g., openapi-generator) to discover which...
Field state context for the current field being evaluated. Used as `fieldState` in evaluation contexts. @public
Constructor type for form event classes. Defines the shape of event class constructors that can be used with the event ...
Map of field keys to their state information. Used as `formFieldState` in evaluation contexts to access state of any fi...
Form mode enumeration distinguishing between paged and non-paged forms
Special form-state conditions for button disabled logic. These conditions evaluate form or page-level state rather than...
Fields that are allowed as children of Group fields Groups can contain: rows and leaf fields (but NOT pages or other gro...
Infer form value type from fields array or FormConfig. Recursively processes nested structures and merges the results. L...
Derive the `FieldRegistryWrappers` augmentation shape from a wrapper bundle. Maps each registration's `wrapperName` to ...
Union type of all registered leaf field definitions
Union type for all logic configurations. - `StateLogicConfig`: For field state changes (hidden, readonly, disabled, req...
Mapper function that converts a field definition to component inputs. Mappers run within an injection context and can i...
Narrow a field definition based on its `type` property. Use this to get proper type inference when working with field un...
Narrow each field in an array based on its `type` property. Use with `satisfies` to get proper type inference for field ...
Logic config restricted to types valid for non-form-bound elements. This is a subset of LogicConfig that only includes h...
Allowed logic types for non-form-bound elements (buttons, text fields, etc.). These elements only support hidden and dis...
Type constraints for field nesting rules These ensure that container fields can only contain valid child field types No...
Union type of all registered field definitions
Fully resolved exclusion config with all properties required. Produced by the 3-tier resolution: `field ?? form ?? globa...
Row is a synthetic field type that resolves to a Container at runtime, so it accepts the same children as a Container.
Configuration for conditional field state logic. Defines how field behavior changes based on conditions. Supports hidin...
The result type for submission actions. Can be either a Promise or an Observable. For success: return `undefined`, `nul...
Text element type for rendering different HTML text elements
Properties for text field configuration
Re-export Angular's ValidationError for consistency This replaces our custom ValidationError interface
Configuration for signal forms validator functions that can be serialized from API. Discriminated union type for type-sa...
Defines how a field type handles form values and data collection. - 'include': Field contributes to form values (defaul...
Supported primitive value types for form fields. This type represents all possible value types that can be used in form ...
Resolves a wrapper type name to its registered config interface. When `TWrappers` is a specific registered key (e.g., `...
Functions 51
Applies meta attributes to a DOM element and tracks which attributes were applied. This utility handles: - Removing pre...
Builder for array manipulation events. Provides a fluent, discoverable API for array operations. Type `arrayEvent('key'...
Maps an array field definition to component inputs. Array components create nested form structures under the array's ke...
Base field mapper that extracts common field properties into component inputs. Returns a Signal containing the Record o...
Builds base input properties from a field definition. This is a helper function that extracts common field properties. ...
Maps a container field definition to component inputs. Container components are layout containers that don't change the...
Creates a typed field configuration with helpful error messages for common mistakes. This helper function provides earl...
Bundle wrapper registrations into a single object that can be passed to `provideDynamicForm(...)`.
Converts DynamicText (string | Observable | Signal) to Observable<string> Unifies all three types into a consistent Obse...
Evaluates the disabled state for non-form-bound elements synchronously. This is a pure function (no signal allocation) ...
Evaluates the hidden state for non-form-bound elements synchronously. This is a pure function (no signal allocation) th...
Shorthand alias for createField
Type-safe form config builder that ensures schema matches field structure. This helper function provides type safety wh...
Get the length of an array FieldTree.
Maps a group field definition to component inputs. Group components create nested form structures under the group's key...
Type guard to check if a form event has a form value attached. Use this to safely access the `formValue` property on ev...
Interpolates {{param}} placeholders in message with error values
Type guard for ArrayField with proper type narrowing. Validates that the field is an array type with a fields property t...
Type guard to check if a field is a container field (page, row, group, or array) Container fields have a 'fields' proper...
Type guard for ContainerField with proper type narrowing. `wrappers` is part of the type but optional in practice — man...
Type guard to check if a field is excluded from form values (display-only field) Currently this includes text fields and...
Performs a deep equality comparison between two values. Handles: - Primitives (including NaN via Object.is) - Dates (by...
Type guard to check if a condition is a FormStateCondition.
Type guard for GroupField with proper type narrowing
Type guard to check if a field is a leaf field (value or display field) Leaf fields don't have children and either contr...
Type guard for PageField with proper type narrowing
Type guard for RowField with proper type narrowing
Type guard for SimplifiedArrayField. Checks for `type: 'array'` with a `template` property (discriminant from full Array...
Type guard to check if a field has a value property (value-bearing field) These fields contribute to the form value outp...
Type guard for a `WrappersBundle`.
Type guard for WrapperTypeDefinition. Discriminates via `wrapperName` — field types use `name`, wrapper types use `wrap...
Creates a new object without the specified keys Native replacement for lodash omit()
Maps a page field definition to component inputs. Page fields are layout containers that don't modify the form context....
Provider function to configure the dynamic form system with field types and options. This function creates environment ...
Resolves the disabled state for a next page button. The disabled state is determined by (in order of precedence): 1. Ex...
Resolves the disabled state for non-form-bound elements as a reactive signal. Wraps {@link evaluateNonFieldDisabled} in...
Resolves the hidden state for non-form-bound elements as a reactive signal. Wraps {@link evaluateNonFieldHidden} in a `...
Resolves the disabled state for a submit button. The disabled state is determined by (in order of precedence): 1. Expli...
Resolves special tokens in event arguments to their actual values Supported tokens: - $key: The current field key - $in...
Maps a row field definition to container component inputs. `row` is a virtual field type: it resolves to `ContainerFiel...
Maps a text field definition to component inputs. Text fields are display-only fields that don't participate in the for...
Build a `ReadonlyFieldTree` by extracting the whitelisted read signals from a Signal Forms `FieldTree`. Returns a fresh ...
Enables automatic form value attachment to all events dispatched through the EventBus. When this feature is enabled, ev...
Configure logging for dynamic forms. By default, general logging is enabled (ConsoleLogger) and derivation logging is d...
Wraps a `Resource` so that the previous resolved value is preserved while the resource is loading or reloading. This pre...
Configures global value exclusion defaults for form submission output. Value exclusion is **enabled by default** — fiel...
Zero-cost type carrier used in wrapper registrations. Returns `undefined` at runtime but is typed as `T`, so TypeScript...
Constants 11
Injection token for providing array context metadata to mappers and components. This token is optionally provided by Ar...
Built-in field types provided by the dynamic form library. Each field type is validated at compile time using satisfies...
Injection token for form-level default props. Default props are form-wide property defaults that are merged with field-...
Injection token for form-level default validation messages. Default validation messages act as fallbacks when fields ha...
Injection token for form-level default wrappers. Provides a Signal of the `defaultWrappers` array from FormConfig. Cons...
Injection token for the dynamic forms logger. Provided by provideDynamicForm() with ConsoleLogger as default. Override ...
Injection token for the global field type registry. Provides access to the map of registered field types throughout the...
Injection token for providing field signal context to mappers and components. The field signal context is the "nervous ...
Injection token for form-level options. Form options control form-wide behavior including button disabled states. Used ...
Injection token for configuring the initialization timeout in milliseconds. Defaults to 10 seconds. When the timeout is ...
Injection token for the wrapper type registry. Provides access to the map of registered wrapper types. The registry is ...