* 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, )
| 570 | * @param tNode The static data for this node |
| 571 | */ |
| 572 | function setInputsFromAttrs<T>( |
| 573 | lView: LView, |
| 574 | directiveIndex: number, |
| 575 | instance: T, |
| 576 | def: DirectiveDef<T>, |
| 577 | tNode: TNode, |
| 578 | initialInputData: InitialInputData, |
| 579 | ): void { |
| 580 | const initialInputs: InitialInputs | null = initialInputData![directiveIndex]; |
| 581 | if (initialInputs !== null) { |
| 582 | for (let i = 0; i < initialInputs.length; i += 2) { |
| 583 | const lookupName = initialInputs[i]; |
| 584 | const value = initialInputs[i + 1]; |
| 585 | |
| 586 | writeToDirectiveInput<T>(def, instance, lookupName, value); |
| 587 | |
| 588 | if (ngDevMode) { |
| 589 | setNgReflectProperty(lView, tNode, def.inputs[lookupName][0], value); |
| 590 | } |
| 591 | } |
| 592 | } |
| 593 | } |
| 594 | |
| 595 | /** Shared code between instructions that indicate the start of an element. */ |
| 596 | export function elementLikeStartShared( |
no test coverage detected