MCPcopy Index your code
hub / github.com/angular/angular / matchTNode

Method matchTNode

packages/core/src/render3/queries/query.ts:255–281  ·  view source on GitHub ↗
(tView: TView, tNode: TNode)

Source from the content-addressed store, hash-verified

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) {

Callers 1

elementStartMethod · 0.95

Calls 4

getIdxOfMatchingSelectorFunction · 0.85
isArrayMethod · 0.80

Tested by

no test coverage detected