* 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, )
| 551 | * @param tNode The static data for this node |
| 552 | */ |
| 553 | function 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. */ |
| 577 | export function elementLikeStartShared( |
no test coverage detected
searching dependent graphs…