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

Function setupRadioGroup

packages/forms/signals/test/web/form_field.spec.ts:6485–6510  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6483});
6484
6485function setupRadioGroup() {
6486 @Component({
6487 imports: [FormField],
6488 template: `
6489 <form>
6490 <input type="radio" value="a" [formField]="f" />
6491 <input type="radio" value="b" [formField]="f" />
6492 <input type="radio" value="c" [formField]="f" />
6493 </form>
6494 `,
6495 })
6496 class TestCmp {
6497 f = form(signal('a'), {
6498 name: 'test',
6499 });
6500 }
6501
6502 const fix = act(() => TestBed.createComponent(TestCmp));
6503 const formEl = (fix.nativeElement as HTMLElement).firstChild as HTMLFormElement;
6504 const inputs = Array.from(formEl.children) as HTMLInputElement[];
6505
6506 const [inputA, inputB, inputC] = inputs;
6507 const cmp = fix.componentInstance as TestCmp;
6508
6509 return {cmp, inputA, inputB, inputC};
6510}
6511
6512function setupRadioWithBindingsGroup() {
6513 enum ABC {

Callers 1

form_field.spec.tsFile · 0.85

Calls 2

actFunction · 0.70
createComponentMethod · 0.65

Tested by

no test coverage detected