MCPcopy
hub / github.com/angular/angular / constructor

Method constructor

packages/core/test/bundling/create_component/main.ts:38–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36 readonly viewContainerRef = inject(ViewContainerRef);
37
38 constructor() {
39 // Create a component with an input binding.
40 this.viewContainerRef.createComponent(FieldComponent, {
41 bindings: [inputBinding('formField', () => 'Input from dynamic component')],
42 });
43
44 // Create a component with a directive with an input binding.
45 this.viewContainerRef.createComponent(HostComponent, {
46 directives: [
47 {
48 type: FieldDirective,
49 bindings: [inputBinding('formField', () => 'Input from dynamic directive')],
50 },
51 ],
52 });
53 }
54}
55
56bootstrapApplication(Root);

Callers

nothing calls this directly

Calls 2

inputBindingFunction · 0.90
createComponentMethod · 0.65

Tested by

no test coverage detected