标签:htm gis void 初步 template less component com highlight
@angular/forms里有个接口用来实现支持[(ngModel)],具体可查ControlValueAccessor,这边还未深入理解只是为了开发组件而初步了解
interface ControlValueAccessor { writeValue(obj: any): void registerOnChange(fn: any): void registerOnTouched(fn: any): void ... }
我们要做的事就是实现这个接口
import {NG_VALUE_ACCESSOR,ControlValueAccessor} from "@angular/forms" @Component({ selector: ‘app-search-select‘, templateUrl: ‘./search-select.component.html‘, styleUrls: [‘./search-select.component.less‘], providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SearchSelectComponent), multi: true }] })
标签:htm gis void 初步 template less component com highlight
原文地址:https://www.cnblogs.com/llcMite/p/11449516.html