🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@leonsenft
Copy link
Contributor

FormValueControl and FormCheckboxControl no longer require that value and checked are implemented as model() signals. The interfaces have been relaxed to accept separate input() and output() definitions to facilitate integration with existing controls.

When designing a new control, model() should be preferred.

// Preferred
class implements FormValueControl<string> {
  readonly value: model.required<string>();
}

// Okay
class MyFormControl implements FormValueControl<string> {
  readonly value: input.required<string>();
  readonly valueChange: output<string>();
}

Fix #65478

`FormValueControl` and `FormCheckboxControl` no longer require that
`value` and `checked` are implemented as `model()` signals. The
interfaces have been relaxed to accept separate `input()` and `output()`
definitions to facilitate integration with existing controls.

When designing a new control, `model()` should be preferred.

```ts
// Preferred
class implements FormValueControl<string> {
  readonly value: model.required<string>();
}

// Okay
class MyFormControl implements FormValueControl<string> {
  readonly value: input.required<string>();
  readonly valueChange: output<string>();
}
```

Fix angular#65478
@leonsenft leonsenft added area: forms target: patch This PR is targeted for the next patch release forms: signals labels Dec 12, 2025
@ngbot ngbot bot added this to the Backlog milestone Dec 12, 2025
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.

Signal forms: Support FormValueControl implementation with input and output signals

1 participant