(viewRef: ViewRef)
| 229 | * - `null` in case of an embedded view |
| 230 | */ |
| 231 | export function getLNodeForHydration(viewRef: ViewRef): LView | LContainer | null { |
| 232 | // Reading an internal field from `ViewRef` instance. |
| 233 | let lView = (viewRef as any)._lView as LView; |
| 234 | const tView = lView[TVIEW]; |
| 235 | // A registered ViewRef might represent an instance of an |
| 236 | // embedded view, in which case we do not need to annotate it. |
| 237 | if (tView.type === TViewType.Embedded) { |
| 238 | return null; |
| 239 | } |
| 240 | // Check if it's a root view and if so, retrieve component's |
| 241 | // LView from the first slot after the header. |
| 242 | if (isRootView(lView)) { |
| 243 | lView = lView[HEADER_OFFSET]; |
| 244 | } |
| 245 | |
| 246 | return lView; |
| 247 | } |
| 248 | |
| 249 | function getTextNodeContent(node: Node): string | undefined { |
| 250 | return node.textContent?.replace(/\s/gm, ''); |
no test coverage detected
searching dependent graphs…