(componentDef: ComponentDef<unknown>)
| 106 | } |
| 107 | |
| 108 | function verifyNotAnOrphanComponent(componentDef: ComponentDef<unknown>) { |
| 109 | // TODO(pk): create assert that verifies ngDevMode |
| 110 | if ( |
| 111 | (typeof ngJitMode === 'undefined' || ngJitMode) && |
| 112 | componentDef.debugInfo?.forbidOrphanRendering |
| 113 | ) { |
| 114 | if (depsTracker.isOrphanComponent(componentDef.type as Type<any>)) { |
| 115 | throw new RuntimeError( |
| 116 | RuntimeErrorCode.RUNTIME_DEPS_ORPHAN_COMPONENT, |
| 117 | `Orphan component found! Trying to render the component ${debugStringifyTypeForError( |
| 118 | componentDef.type, |
| 119 | )} without first loading the NgModule that declares it. It is recommended to make this component standalone in order to avoid this error. If this is not possible now, import the component's NgModule in the appropriate NgModule, or the standalone component in which you are trying to render this component. If this is a lazy import, load the NgModule lazily as well and use its module injector.`, |
| 120 | ); |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | function createRootViewInjector( |
| 126 | componentDef: ComponentDef<unknown>, |
no test coverage detected
searching dependent graphs…