$addControl(control);
Register a control with the form. Input elements using ngModelController do this automatically when they are linked.
Note that the current state of the control will not be reflected on the new parent form. This is not an issue with normal use, as freshly compiled and linked controls are in a $pristine
state.
However, if the method is used programmatically, for example by adding dynamically created controls, or controls that have been previously removed without destroying their corresponding DOM element, it's the developers responsibility to make sure the current state propagates to the parent form.
For example, if an input control is added that is already $dirty
and has $error
properties, calling $setDirty()
and $validate()
afterwards will propagate the state to the parent form.
Parameters
Param | Type | Details |
---|---|---|
control | object | control object, either a |
Please login to continue.