custom form control 之前就写过了,这里简单写一下. 创建一个组件实现 ControlValueAccessor 接口 @Component({ providers: [ { provide: NG_VALUE_ACCESSOR, multi: true, useExisting: MyInputComponent }, ], }) export class MyInputComponent implements ControlValueAccessor {} 实现 write…