( lView: LView, tView: TView, tNode: TNode, publicName: string, value: any, )
| 348 | } |
| 349 | |
| 350 | export 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. |
no test coverage detected
searching dependent graphs…