MCPcopy
hub / github.com/angular/angular / setAllInputsForProperty

Function setAllInputsForProperty

packages/core/src/render3/instructions/shared.ts:730–763  ·  view source on GitHub ↗
(
  tNode: TNode,
  tView: TView,
  lView: LView,
  publicName: string,
  value: unknown,
)

Source from the content-addressed store, hash-verified

728 * @param value Value to set.
729 */
730export function setAllInputsForProperty(
731 tNode: TNode,
732 tView: TView,
733 lView: LView,
734 publicName: string,
735 value: unknown,
736): boolean {
737 const inputs = tNode.inputs?.[publicName];
738 const hostDirectiveInputs = tNode.hostDirectiveInputs?.[publicName];
739 let hasMatch = false;
740
741 if (hostDirectiveInputs) {
742 for (let i = 0; i < hostDirectiveInputs.length; i += 2) {
743 const index = hostDirectiveInputs[i] as number;
744 ngDevMode && assertIndexInRange(lView, index);
745 const publicName = hostDirectiveInputs[i + 1] as string;
746 const def = tView.data[index] as DirectiveDef<unknown>;
747 writeToDirectiveInput(def, lView[index], publicName, value);
748 hasMatch = true;
749 }
750 }
751
752 if (inputs) {
753 for (const index of inputs) {
754 ngDevMode && assertIndexInRange(lView, index);
755 const instance = lView[index];
756 const def = tView.data[index] as DirectiveDef<any>;
757 writeToDirectiveInput(def, instance, publicName, value);
758 hasMatch = true;
759 }
760 }
761
762 return hasMatch;
763}
764
765/**
766 * Sets an input value only on a specific directive and its host directives.

Callers 4

setInputMethod · 0.90
ɵɵariaPropertyFunction · 0.90
setPropertyAndInputsFunction · 0.85

Calls 2

assertIndexInRangeFunction · 0.90
writeToDirectiveInputFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…