MCPcopy Create free account
hub / github.com/angular/angular / createEmbeddedView

Method createEmbeddedView

packages/core/src/render3/queries/query.ts:51–72  ·  view source on GitHub ↗
(tView: TView)

Source from the content-addressed store, hash-verified

49 constructor(public queries: LQuery<any>[] = []) {}
50
51 createEmbeddedView(tView: TView): LQueries | null {
52 const tQueries = tView.queries;
53 if (tQueries !== null) {
54 const noOfInheritedQueries =
55 tView.contentQueries !== null ? tView.contentQueries[0] : tQueries.length;
56 const viewLQueries: LQuery<any>[] = [];
57
58 // An embedded view has queries propagated from a declaration view at the beginning of the
59 // TQueries collection and up until a first content query declared in the embedded view. Only
60 // propagated LQueries are created at this point (LQuery corresponding to declared content
61 // queries will be instantiated from the content query instructions for each directive).
62 for (let i = 0; i < noOfInheritedQueries; i++) {
63 const tQuery = tQueries.getByIndex(i);
64 const parentLQuery = this.queries[tQuery.indexInDeclarationView];
65 viewLQueries.push(parentLQuery.clone());
66 }
67
68 return new LQueries_(viewLQueries);
69 }
70
71 return null;
72 }
73
74 insertView(tView: TView): void {
75 this.dirtyQueriesWithMatches(tView);

Callers

nothing calls this directly

Calls 3

getByIndexMethod · 0.65
cloneMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected