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

Function setNgReflectProperties

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

Source from the content-addressed store, hash-verified

348}
349
350export function setNgReflectProperties(
351 lView: LView,
352 tView: TView,
353 tNode: TNode,
354 publicName: string,
355 value: any,
356) {
357 const environment = lView[ENVIRONMENT];
358 if (!environment.ngReflect || !(tNode.type & (TNodeType.AnyRNode | TNodeType.Container))) {
359 return;
360 }
361
362 const inputConfig = tNode.inputs?.[publicName];
363 const hostInputConfig = tNode.hostDirectiveInputs?.[publicName];
364
365 if (hostInputConfig) {
366 for (let i = 0; i < hostInputConfig.length; i += 2) {
367 const index = hostInputConfig[i] as number;
368 const publicName = hostInputConfig[i + 1] as string;
369 const def = tView.data[index] as DirectiveDef<unknown>;
370 setNgReflectProperty(lView, tNode, def.inputs[publicName][0], value);
371 }
372 }
373
374 // Note: we set the private name of the input as the reflected property, not the public one.
375 if (inputConfig) {
376 for (const index of inputConfig) {
377 const def = tView.data[index] as DirectiveDef<unknown>;
378 setNgReflectProperty(lView, tNode, def.inputs[publicName][0], value);
379 }
380 }
381}
382
383/**
384 * Instantiate all the directives that were previously resolved on the current node.

Callers 2

ɵɵariaPropertyFunction · 0.90
setPropertyAndInputsFunction · 0.85

Calls 1

setNgReflectPropertyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…