И
Size: a a a
И
А
СТ
Р
АЖ
АЖ
А
export class CustomInputComponent implements OnInit, ControlValueAccessor {
@Input() type: any;
@Input() placeholder: string = '';
@Input() readOnly: any;
constructor() {}
public onChange: any = () => {};
private _value = '';
public onTouch: any = () => {};
public get value() {
return this._value;
}
public set value(v) {
this._value = v;
if (this.onChange) {
this.onChange(this._value);
}
}
ngOnInit() {}
registerOnChange(fn: any): void {
this.onChange = fn;
this.onChange(this._value);
}
registerOnTouched(fn: any): void {
this.onTouch = fn;
this.onTouch(this._value)
}
writeValue(value: any): void {
this.value = value;
}
}А
<input
[(ngModel)]="value"
class="input"
(change)="onChange(inputRef.value)"
[value]="value"
#inputRef
/>
АЖ
АЖ
АЖ
А
АЖ
IA

АЖ
АЖ
А
А
А