MCPcopy Create free account
hub / github.com/angular/angular / constructor

Method constructor

packages/core/test/linker/integration_spec.ts:2478–2486  ·  view source on GitHub ↗
(private vc: ViewContainerRef)

Source from the content-addressed store, hash-verified

2476class DynamicViewport {
2477 private injector: Injector;
2478 constructor(private vc: ViewContainerRef) {
2479 const myService = new MyService();
2480 myService.greeting = 'dynamic greet';
2481
2482 this.injector = Injector.create({
2483 providers: [{provide: MyService, useValue: myService}],
2484 parent: vc.injector,
2485 });
2486 }
2487
2488 create(): ComponentRef<ChildCompUsingService> {
2489 return this.vc.createComponent(ChildCompUsingService, {

Callers

nothing calls this directly

Calls 1

createMethod · 0.65

Tested by

no test coverage detected