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