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