ControlValueAccessorlink
A ControlValueAccessor
acts as a bridge between the Angular forms API and a native element in the DOM.
说明
Implement this interface if you want to create a custom form control directive that integrates with Angular forms.
方法
Registers a callback function that should be called when the control's value changes in the UI. | ||
参数
返回值
| ||
This is called by the forms API on initialization so it can update the form model when values propagate from the view (view -> model). If you are implementing When the value changes in the UI, your class should call the registered function to allow the forms API to update itself: |
Registers a callback function that should be called when the control receives a blur event. | ||
参数
返回值
| ||
This is called by the forms API on initialization so it can update the form model on blur. If you are implementing On blur (or equivalent), your class should call the registered function to allow the forms API to update itself: |
This function is called by the forms API when the control status changes to or from "DISABLED". Depending on the value, it should enable or disable the appropriate DOM element. | ||
参数
返回值
| ||
Example implementation of |