( propName: string, value: T | WritableSignal<T>, sanitizer?: SanitizerFn | null, )
| 31 | * @codeGenApi |
| 32 | */ |
| 33 | export 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. |
nothing calls this directly
no test coverage detected
searching dependent graphs…