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

Function getOrCreateComponentTView

packages/core/src/render3/view/construction.ts:146–171  ·  view source on GitHub ↗
(def: ComponentDef<any>)

Source from the content-addressed store, hash-verified

144 * @returns TView
145 */
146export function getOrCreateComponentTView(def: ComponentDef<any>): TView {
147 const tView = def.tView;
148
149 // Create a TView if there isn't one, or recreate it if the first create pass didn't
150 // complete successfully since we can't know for sure whether it's in a usable shape.
151 if (tView === null || tView.incompleteFirstPass) {
152 // Declaration node here is null since this function is called when we dynamically create a
153 // component and hence there is no declaration.
154 const declTNode = null;
155 return (def.tView = createTView(
156 TViewType.Component,
157 declTNode,
158 def.template,
159 def.decls,
160 def.vars,
161 def.directiveDefs,
162 def.pipeDefs,
163 def.viewQuery,
164 def.schemas,
165 def.consts,
166 def.id,
167 ));
168 }
169
170 return tView;
171}
172
173export function createLView<T>(
174 parentLView: LView | null,

Callers 2

recreateFunction · 0.90
createComponentLViewFunction · 0.85

Calls 1

createTViewFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…