(
injector: Injector,
projectableNodes?: any[][] | undefined,
rootSelectorOrNode?: any,
environmentInjector?: NgModuleRef<any> | EnvironmentInjector | undefined,
directives?: (Type<unknown> | DirectiveWithBindings<unknown>)[],
componentBindings?: Binding[],
)
| 256 | } |
| 257 | |
| 258 | create( |
| 259 | injector: Injector, |
| 260 | projectableNodes?: any[][] | undefined, |
| 261 | rootSelectorOrNode?: any, |
| 262 | environmentInjector?: NgModuleRef<any> | EnvironmentInjector | undefined, |
| 263 | directives?: (Type<unknown> | DirectiveWithBindings<unknown>)[], |
| 264 | componentBindings?: Binding[], |
| 265 | ): AbstractComponentRef<T> { |
| 266 | profiler(ProfilerEvent.DynamicComponentStart); |
| 267 | |
| 268 | const prevConsumer = setActiveConsumer(null); |
| 269 | try { |
| 270 | const cmpDef = this.componentDef; |
| 271 | ngDevMode && verifyNotAnOrphanComponent(cmpDef); |
| 272 | const rootViewInjector = createRootViewInjector( |
| 273 | cmpDef, |
| 274 | environmentInjector || this.ngModule, |
| 275 | injector, |
| 276 | ); |
| 277 | const environment = createRootLViewEnvironment(rootViewInjector); |
| 278 | const tracingService = environment.tracingService; |
| 279 | |
| 280 | if (tracingService && tracingService.componentCreate) { |
| 281 | return tracingService.componentCreate(getComponentName(cmpDef), () => |
| 282 | this.createComponentRef( |
| 283 | environment, |
| 284 | rootViewInjector, |
| 285 | projectableNodes, |
| 286 | rootSelectorOrNode, |
| 287 | directives, |
| 288 | componentBindings, |
| 289 | ), |
| 290 | ); |
| 291 | } else { |
| 292 | return this.createComponentRef( |
| 293 | environment, |
| 294 | rootViewInjector, |
| 295 | projectableNodes, |
| 296 | rootSelectorOrNode, |
| 297 | directives, |
| 298 | componentBindings, |
| 299 | ); |
| 300 | } |
| 301 | } finally { |
| 302 | setActiveConsumer(prevConsumer); |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | private createComponentRef( |
| 307 | environment: LViewEnvironment, |
no test coverage detected