* Internal method to process the scoped node and populate the `Scope`.
(nodeOrNodes: ScopedNode | Node[])
| 332 | * Internal method to process the scoped node and populate the `Scope`. |
| 333 | */ |
| 334 | private ingest(nodeOrNodes: ScopedNode | Node[]): void { |
| 335 | if (nodeOrNodes instanceof Template) { |
| 336 | // Variables on an <ng-template> are defined in the inner scope. |
| 337 | nodeOrNodes.variables.forEach((node) => this.visitVariable(node)); |
| 338 | |
| 339 | // Process the nodes of the template. |
| 340 | nodeOrNodes.children.forEach((node) => node.visit(this)); |
| 341 | } else if (nodeOrNodes instanceof IfBlockBranch) { |
| 342 | if (nodeOrNodes.expressionAlias !== null) { |
| 343 | this.visitVariable(nodeOrNodes.expressionAlias); |
| 344 | } |
| 345 | nodeOrNodes.children.forEach((node) => node.visit(this)); |
| 346 | } else if (nodeOrNodes instanceof ForLoopBlock) { |
| 347 | this.visitVariable(nodeOrNodes.item); |
| 348 | nodeOrNodes.contextVariables.forEach((v) => this.visitVariable(v)); |
| 349 | nodeOrNodes.children.forEach((node) => node.visit(this)); |
| 350 | } else if ( |
| 351 | nodeOrNodes instanceof SwitchBlockCaseGroup || |
| 352 | nodeOrNodes instanceof ForLoopBlockEmpty || |
| 353 | nodeOrNodes instanceof DeferredBlock || |
| 354 | nodeOrNodes instanceof DeferredBlockError || |
| 355 | nodeOrNodes instanceof DeferredBlockPlaceholder || |
| 356 | nodeOrNodes instanceof DeferredBlockLoading || |
| 357 | nodeOrNodes instanceof ContentBlock || |
| 358 | nodeOrNodes instanceof Content |
| 359 | ) { |
| 360 | nodeOrNodes.children.forEach((node) => node.visit(this)); |
| 361 | } else if (!(nodeOrNodes instanceof HostElement)) { |
| 362 | // No overarching `Template` instance, so process the nodes directly. |
| 363 | nodeOrNodes.forEach((node) => node.visit(this)); |
| 364 | } |
| 365 | } |
| 366 | |
| 367 | visitElement(element: Element) { |
| 368 | this.visitElementLike(element); |
no test coverage detected