MCPcopy
hub / github.com/angular/angular / onChange

Function onChange

packages/forms/src/directives/shared.ts:292–298  ·  view source on GitHub ↗
(newValue?: any, emitModelEvent?: boolean)

Source from the content-addressed store, hash-verified

290
291function setUpModelChangePipeline(control: FormControl, dir: NgControl): void {
292 const onChange = (newValue?: any, emitModelEvent?: boolean) => {
293 // control -> view
294 dir.valueAccessor!.writeValue(newValue);
295
296 // control -> ngModel
297 if (emitModelEvent) dir.viewToModelUpdate(newValue);
298 };
299 control.registerOnChange(onChange);
300
301 // Register a callback function to cleanup onChange handler

Callers 1

setupSwMethod · 0.85

Calls 2

writeValueMethod · 0.65
viewToModelUpdateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…