( lView: LView, hostTNode: TElementNode, def: ComponentDef<T>, )
| 224 | } |
| 225 | |
| 226 | export function createComponentLView<T>( |
| 227 | lView: LView, |
| 228 | hostTNode: TElementNode, |
| 229 | def: ComponentDef<T>, |
| 230 | ): LView { |
| 231 | const native = getNativeByTNode(hostTNode, lView) as RElement; |
| 232 | const tView = getOrCreateComponentTView(def); |
| 233 | |
| 234 | // Only component views should be added to the view tree directly. Embedded views are |
| 235 | // accessed through their containers because they may be removed / re-added later. |
| 236 | const rendererFactory = lView[ENVIRONMENT].rendererFactory; |
| 237 | const componentView = addToEndOfViewTree( |
| 238 | lView, |
| 239 | createLView( |
| 240 | lView, |
| 241 | tView, |
| 242 | null, |
| 243 | getInitialLViewFlagsFromDef(def), |
| 244 | native, |
| 245 | hostTNode as TElementNode, |
| 246 | null, |
| 247 | rendererFactory.createRenderer(native, def), |
| 248 | null, |
| 249 | null, |
| 250 | null, |
| 251 | ), |
| 252 | ); |
| 253 | |
| 254 | // Component view will always be created before any injected LContainers, |
| 255 | // so this is a regular element, wrap it with the component view |
| 256 | return (lView[hostTNode.index] = componentView); |
| 257 | } |
| 258 | |
| 259 | /** |
| 260 | * Gets the initial set of LView flags based on the component definition that the LView represents. |
no test coverage detected
searching dependent graphs…