(tNode: TNode, lView: LView)
| 232 | } |
| 233 | |
| 234 | export function getInjectorIndex(tNode: TNode, lView: LView): number { |
| 235 | if ( |
| 236 | tNode.injectorIndex === -1 || |
| 237 | // If the injector index is the same as its parent's injector index, then the index has been |
| 238 | // copied down from the parent node. No injector has been created yet on this node. |
| 239 | (tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex) || |
| 240 | // After the first template pass, the injector index might exist but the parent values |
| 241 | // might not have been calculated yet for this instance |
| 242 | lView[tNode.injectorIndex + NodeInjectorOffset.PARENT] === null |
| 243 | ) { |
| 244 | return -1; |
| 245 | } else { |
| 246 | ngDevMode && assertIndexInRange(lView, tNode.injectorIndex); |
| 247 | return tNode.injectorIndex; |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | /** |
| 252 | * Finds the index of the parent injector, with a view offset if applicable. Used to set the |
no test coverage detected
searching dependent graphs…