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

Function setupRadioGroup

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

Source from the content-addressed store, hash-verified

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

Callers 1

form_field.spec.tsFile · 0.85

Calls 2

actFunction · 0.90
createComponentMethod · 0.65

Tested by

no test coverage detected