Skip to content

test(forms): support directive composition with FormField#67660

Open
leonsenft wants to merge 1 commit intoangular:mainfrom
leonsenft:sf-form-field-host-directive
Open

test(forms): support directive composition with FormField#67660
leonsenft wants to merge 1 commit intoangular:mainfrom
leonsenft:sf-form-field-host-directive

Conversation

@leonsenft
Copy link
Contributor

@leonsenft leonsenft commented Mar 12, 2026

Support composing the FormField directive with custom controls:

@Component({
  hostDirectives: [
    {directive: FormField, inputs: ['formField']},
  ],
})
export class MyControl implements FormValueControl<...> { ... }

IMPORTANT: The formField input must be exposed as-is, without aliasing to function property.

For more on directive composition, see
https://angular.dev/guide/directives/directive-composition-api.

@leonsenft leonsenft requested a review from kirjs March 12, 2026 20:49
@leonsenft leonsenft added area: forms target: patch This PR is targeted for the next patch release forms: signals labels Mar 12, 2026
@ngbot ngbot bot added this to the Backlog milestone Mar 12, 2026
Support composing the `FormField` directive with custom controls:

```ts
import {FormField, FormValueControl} from '@angular/forms/signals';

@component({
  hostDirectives: [
    {directive: FormField, inputs: ['formField']},
  ],
})
export class MyControl implements FormValueControl<...> { ... }
```

IMPORTANT: The `formField` input _must_ be exposed as-is, without
aliasing to function properly.

For more on directive composition, see
https://angular.dev/guide/directives/directive-composition-api.
@leonsenft
Copy link
Contributor Author

@arm1n Please let me know if this fails to address your use case, at head FormField as a host directive appears to simply be working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: forms forms: signals target: patch This PR is targeted for the next patch release

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant