MCPcopy
hub / github.com/angular/angular / createEmbeddedView

Method createEmbeddedView

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

Source from the content-addressed store, hash-verified

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