๐ข Simplest Signal Form
Information
Angular has introduced a new way to work with forms using Signals. This modern approach provides better type safety, reactivity, and a more intuitive API compared to traditional Reactive Forms. You can find more information about Signal-based forms in the Angular documentation.
In this challenge, you will learn how to migrate a simple form from Reactive Forms (FormControl and FormGroup) to the new Signal-based Forms API.
Statement
The application currently contains a simple form built with Reactive Forms using FormControl and FormGroup. The form includes the following fields:
- Name (required)
- Last Name (optional)
- Age (must be between 1 and 99)
- Note (optional)
Your goal is to refactor this form to use Angularโs new Signal-based Forms API while maintaining the same functionality and validation rules.
Current Implementation
The form currently uses:
FormGroupto group form controlsFormControlfor individual fieldsValidatorsfor validation rulesReactiveFormsModulefor form directives
Expected Result
After completing the challenge, your form should:
- Use Signal-based form instead of
FormControlandFormGroup - Maintain all existing validation rules
- Keep the same UI and user experience
- Display validation errors appropriately
- Submit and reset functionality should work as before
- All existing tests should continue to pass when running
nx test forms-simplest-signal-form