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

Function setupRadioGroup

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

Source from the content-addressed store, hash-verified

6872});
6873
6874function setupRadioGroup() {
6875 @Component({
6876 imports: [FormField],
6877 template: `
6878 <form>
6879 <input type="radio" value="a" [formField]="f" />
6880 <input type="radio" value="b" [formField]="f" />
6881 <input type="radio" value="c" [formField]="f" />
6882 </form>
6883 `,
6884 })
6885 class TestCmp {
6886 f = form(signal('a'), {
6887 name: 'test',
6888 });
6889 }
6890
6891 const fix = act(() => TestBed.createComponent(TestCmp));
6892 const formEl = (fix.nativeElement as HTMLElement).firstChild as HTMLFormElement;
6893 const inputs = Array.from(formEl.children) as HTMLInputElement[];
6894
6895 const [inputA, inputB, inputC] = inputs;
6896 const cmp = fix.componentInstance as TestCmp;
6897
6898 return {cmp, inputA, inputB, inputC};
6899}
6900
6901function setupRadioWithBindingsGroup() {
6902 enum ABC {

Callers 1

form_field.spec.tsFile · 0.85

Calls 3

actFunction · 0.90
createComponentMethod · 0.65
fromMethod · 0.45

Tested by

no test coverage detected