(viewOrComponent: LView<T> | {})
| 40 | * @param viewOrComponent the `LView` or component to get the root context for. |
| 41 | */ |
| 42 | export function getRootContext<T>(viewOrComponent: LView<T> | {}): T { |
| 43 | const rootView = getRootView(viewOrComponent); |
| 44 | ngDevMode && |
| 45 | assertDefined(rootView[CONTEXT], 'Root view has no context. Perhaps it is disconnected?'); |
| 46 | return rootView[CONTEXT] as T; |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Gets the first `LContainer` in the LView or `null` if none exists. |
no test coverage detected
searching dependent graphs…