| 45 | } |
| 46 | |
| 47 | class LQueries_ implements LQueries { |
| 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); |
| 75 | } |
| 76 | |
| 77 | detachView(tView: TView): void { |
| 78 | this.dirtyQueriesWithMatches(tView); |
| 79 | } |
| 80 | |
| 81 | finishViewCreation(tView: TView): void { |
| 82 | this.dirtyQueriesWithMatches(tView); |
| 83 | } |
| 84 | |
| 85 | private dirtyQueriesWithMatches(tView: TView) { |
| 86 | for (let i = 0; i < this.queries.length; i++) { |
| 87 | if (getTQuery(tView, i).matches !== null) { |
| 88 | this.queries[i].setDirty(); |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | export class TQueryMetadata_ implements TQueryMetadata { |
| 95 | public predicate: ProviderToken<unknown> | string[]; |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…