MCPcopy
hub / github.com/angular/angular / setupRadioGroup

Function setupRadioGroup

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

Source from the content-addressed store, hash-verified

6424});
6425
6426function setupRadioGroup() {
6427 @Component({
6428 imports: [FormField],
6429 template: `
6430 <form>
6431 <input type="radio" value="a" [formField]="f" />
6432 <input type="radio" value="b" [formField]="f" />
6433 <input type="radio" value="c" [formField]="f" />
6434 </form>
6435 `,
6436 })
6437 class TestCmp {
6438 f = form(signal('a'), {
6439 name: 'test',
6440 });
6441 }
6442
6443 const fix = act(() => TestBed.createComponent(TestCmp));
6444 const formEl = (fix.nativeElement as HTMLElement).firstChild as HTMLFormElement;
6445 const inputs = Array.from(formEl.children) as HTMLInputElement[];
6446
6447 const [inputA, inputB, inputC] = inputs;
6448 const cmp = fix.componentInstance as TestCmp;
6449
6450 return {cmp, inputA, inputB, inputC};
6451}
6452
6453function setupRadioWithBindingsGroup() {
6454 enum ABC {

Callers 1

form_field.spec.tsFile · 0.85

Calls 2

actFunction · 0.70
createComponentMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…