Add framework support for binding form controls #63773
Open
+966
−601
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Move most of the implementation of the
Control
directive into core framework instructions. This allows field state changes to be propagated to their corresponding UI controls directly during execution of a template update block, instead of relying oneffect()
s to synchronize each change later during the update (and too late in the case of required inputs).@angular/core
for signal forms to implement:ɵControl
for theControl
directive.ɵFieldState
for the control's associatedFieldState
.[control]
binding:ɵɵcontrolCreate
sets up theɵControl
directive if present, determines whether it's bound to a native control element or a custom control component, and adds the appropriate event listeners to notify theɵFieldState
of UI changes.ɵɵcontrol
propagates changes fromɵFieldState
properties to their corresponding UI control properties (in additional to binding thecontrol
property itself).Future changes will focus on optimizing the instructions:
TNode
max
/min
for number or date)