MCPcopy Index your code
hub / github.com/angular/angular / ɵɵtwoWayProperty

Function ɵɵtwoWayProperty

packages/core/src/render3/instructions/two_way.ts:33–53  ·  view source on GitHub ↗
(
  propName: string,
  value: T | WritableSignal<T>,
  sanitizer?: SanitizerFn | null,
)

Source from the content-addressed store, hash-verified

31 * @codeGenApi
32 */
33export function ɵɵtwoWayProperty<T>(
34 propName: string,
35 value: T | WritableSignal<T>,
36 sanitizer?: SanitizerFn | null,
37): typeof ɵɵtwoWayProperty {
38 // TODO(crisbeto): perf impact of re-evaluating this on each change detection?
39 if (isWritableSignal(value)) {
40 value = value();
41 }
42
43 const lView = getLView();
44 const bindingIndex = nextBindingIndex();
45 if (bindingUpdated(lView, bindingIndex, value)) {
46 const tView = getTView();
47 const tNode = getSelectedTNode();
48 setPropertyAndInputs(tNode, lView, propName, value, lView[RENDERER], sanitizer);
49 ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);
50 }
51
52 return ɵɵtwoWayProperty;
53}
54
55/**
56 * Function used inside two-way listeners to conditionally set the value of the bound expression.

Callers

nothing calls this directly

Calls 9

isWritableSignalFunction · 0.90
getLViewFunction · 0.90
nextBindingIndexFunction · 0.90
bindingUpdatedFunction · 0.90
getTViewFunction · 0.90
getSelectedTNodeFunction · 0.90
setPropertyAndInputsFunction · 0.90
valueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…