MCPcopy Index your code
hub / github.com/angular/angular / MyInput

Class MyInput

packages/forms/test/value_accessor_integration_spec.ts:2139–2166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2137 standalone: false,
2138})
2139export class MyInput implements ControlValueAccessor {
2140 @Output('input') onInput = new EventEmitter();
2141 value!: string;
2142
2143 control: AbstractControl | null = null;
2144
2145 constructor(public controlDir: NgControl) {
2146 controlDir.valueAccessor = this;
2147 }
2148
2149 ngOnInit() {
2150 this.control = this.controlDir.control;
2151 }
2152
2153 writeValue(value: any) {
2154 this.value = `!${value}!`;
2155 }
2156
2157 registerOnChange(fn: (value: any) => void) {
2158 this.onInput.subscribe({next: fn});
2159 }
2160
2161 registerOnTouched(fn: any) {}
2162
2163 dispatchChangeEvent() {
2164 this.onInput.emit(this.value.substring(1, this.value.length - 1));
2165 }
2166}
2167
2168@Component({
2169 selector: 'my-input-form',

Callers

nothing calls this directly

Calls 1

OutputInterface · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…