多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## DefaultValueAccessor The default accessor for writing a value and listening to changes that is used by the **ngModel**, **FormControlDirective**, **FormControlName**, and **directives** ### 接口 ```typescript class DefaultValueAccessor { constructor(_renderer: Renderer, _elementRef: ElementRef) onChange : (_: any) => {} onTouched : () => {} writeValue(value: any) : void registerOnChange(fn: (_: any) => void) : void registerOnTouched(fn: () => void) : void setDisabledState(isDisabled: boolean) : void } ``` ### 选择器 ```typescript input:not([type=checkbox])[formControlName] textarea[formControlName] input:not([type=checkbox])[formControl] textarea[formControl] input:not([type=checkbox])[ngModel] textarea[ngModel] [ngDefaultControl] ``` ### 属性 - onChange : (_: `any`) => {} - onTouched : () => {} - writeValue(value: `any`) : `void` - registerOnChange(fn: (_: `any`) => `void`) : `void` - registerOnTouched(fn: () => `void`) : `void` - setDisabledState(isDisabled: `boolean`) : `void`