(tView: TView, tNode: TNode)
| 253 | } |
| 254 | |
| 255 | private matchTNode(tView: TView, tNode: TNode): void { |
| 256 | const predicate = this.metadata.predicate; |
| 257 | if (Array.isArray(predicate)) { |
| 258 | for (let i = 0; i < predicate.length; i++) { |
| 259 | const name = predicate[i]; |
| 260 | this.matchTNodeWithReadOption(tView, tNode, getIdxOfMatchingSelector(tNode, name)); |
| 261 | // Also try matching the name to a provider since strings can be used as DI tokens too. |
| 262 | this.matchTNodeWithReadOption( |
| 263 | tView, |
| 264 | tNode, |
| 265 | locateDirectiveOrProvider(tNode, tView, name, false, false), |
| 266 | ); |
| 267 | } |
| 268 | } else { |
| 269 | if ((predicate as any) === ViewEngine_TemplateRef) { |
| 270 | if (tNode.type & TNodeType.Container) { |
| 271 | this.matchTNodeWithReadOption(tView, tNode, -1); |
| 272 | } |
| 273 | } else { |
| 274 | this.matchTNodeWithReadOption( |
| 275 | tView, |
| 276 | tNode, |
| 277 | locateDirectiveOrProvider(tNode, tView, predicate, false, false), |
| 278 | ); |
| 279 | } |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | private matchTNodeWithReadOption(tView: TView, tNode: TNode, nodeMatchIdx: number | null): void { |
| 284 | if (nodeMatchIdx !== null) { |
no test coverage detected