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