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

Function setInputsFromAttrs

packages/core/src/render3/instructions/shared.ts:553–574  ·  view source on GitHub ↗

* Sets initial input properties on directive instances from attribute data * * @param lView Current LView that is being processed. * @param directiveIndex Index of the directive in directives array * @param instance Instance of the directive on which to set the initial inputs * @param def The d

(
  lView: LView,
  directiveIndex: number,
  instance: T,
  def: DirectiveDef<T>,
  tNode: TNode,
  initialInputData: InitialInputData,
)

Source from the content-addressed store, hash-verified

551 * @param tNode The static data for this node
552 */
553function setInputsFromAttrs<T>(
554 lView: LView,
555 directiveIndex: number,
556 instance: T,
557 def: DirectiveDef<T>,
558 tNode: TNode,
559 initialInputData: InitialInputData,
560): void {
561 const initialInputs: InitialInputs | null = initialInputData![directiveIndex];
562 if (initialInputs !== null) {
563 for (let i = 0; i < initialInputs.length; i += 2) {
564 const lookupName = initialInputs[i];
565 const value = initialInputs[i + 1];
566
567 writeToDirectiveInput<T>(def, instance, lookupName, value);
568
569 if (ngDevMode) {
570 setNgReflectProperty(lView, tNode, def.inputs[lookupName][0], value);
571 }
572 }
573 }
574}
575
576/** Shared code between instructions that indicate the start of an element. */
577export function elementLikeStartShared(

Callers 1

instantiateAllDirectivesFunction · 0.85

Calls 2

writeToDirectiveInputFunction · 0.90
setNgReflectPropertyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…