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

Function setupRadioGroup

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

Source from the content-addressed store, hash-verified

6443});
6444
6445function setupRadioGroup() {
6446 @Component({
6447 imports: [FormField],
6448 template: `
6449 <form>
6450 <input type="radio" value="a" [formField]="f" />
6451 <input type="radio" value="b" [formField]="f" />
6452 <input type="radio" value="c" [formField]="f" />
6453 </form>
6454 `,
6455 })
6456 class TestCmp {
6457 f = form(signal('a'), {
6458 name: 'test',
6459 });
6460 }
6461
6462 const fix = act(() => TestBed.createComponent(TestCmp));
6463 const formEl = (fix.nativeElement as HTMLElement).firstChild as HTMLFormElement;
6464 const inputs = Array.from(formEl.children) as HTMLInputElement[];
6465
6466 const [inputA, inputB, inputC] = inputs;
6467 const cmp = fix.componentInstance as TestCmp;
6468
6469 return {cmp, inputA, inputB, inputC};
6470}
6471
6472function setupRadioWithBindingsGroup() {
6473 enum ABC {

Callers 1

form_field.spec.tsFile · 0.85

Calls 2

actFunction · 0.70
createComponentMethod · 0.65

Tested by

no test coverage detected