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

Method create

packages/core/test/acceptance/view_ref_spec.ts:45–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43 ) {}
44
45 create() {
46 this.componentRef = createComponent(DynamicComponent, {environmentInjector: this.injector});
47 (this.componentRef.hostView as InternalViewRef<unknown>).attachToAppRef(this.appRef);
48 document.body.appendChild(this.componentRef.instance.elRef.nativeElement);
49 }
50
51 destroy() {
52 (this.componentRef.hostView as InternalViewRef<unknown>).detachFromAppRef();

Callers

nothing calls this directly

Calls 6

createComponentFunction · 0.90
attachToAppRefMethod · 0.80
appendChildMethod · 0.65
createEmbeddedViewMethod · 0.65
createComponentMethod · 0.65
insertMethod · 0.45

Tested by

no test coverage detected