(def: ComponentDef<any>)
| 144 | * @returns TView |
| 145 | */ |
| 146 | export 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 | |
| 173 | export function createLView<T>( |
| 174 | parentLView: LView | null, |
no test coverage detected
searching dependent graphs…