Forms: Angular 22 practice questions

Forms is 10% of the free Angular 22 mock (5 of 50 questions). Pick an answer to see right away whether it is correct, with the explanation and the documentation section it comes from.

NG.VI · Angular 22 practice question

When breaking a large reactive FormGroup into smaller nested sections, what are the two steps outlined for setting up the nested form?

Choose one answer
Check answer and explanation

Correct answer: Create a nested group, then group the nested form in the template.

Explanation

Setting up a nested reactive form involves two steps: first creating a nested group in the model, and then grouping the nested form in the template.

Common trap

ControlValueAccessor and ngModel are not required for nested reactive FormGroup instances. Converting the root FormGroup into a FormArray is unnecessary for logically grouping named sections.

Source: Angular docs: Reactive forms — Creating nested form groups
Checked against the cited text on 2026-11-25.

Report an error in this question

Open this question on its own page


NG.VI · Angular 22 practice question

When a developer calls a field function in Signal Forms inside a reactive computation, what does the returned FieldState object provide?

Choose one answer
Check answer and explanation

Correct answer: Reactive signals for the field's value, validation status, and interaction state

Explanation

Calling a field in Signal Forms returns a FieldState object that contains reactive signals for the field's value, validation status, and interaction state.

Common trap

A static snapshot of the initial value would not update reactively inside templates or computations. RxJS BehaviorSubjects belong to an observable-based approach, whereas Signal Forms' FieldState exposes reactive signals.

Source: Angular docs: Form models — Reading from field state
Checked against the cited text on 2026-11-25.

Report an error in this question

Open this question on its own page


NG.VI · Angular 22 practice question

A casting application must verify that a requested role is not already taken, but the list of active roles changes constantly in a central database. Why is an async validator appropriate here?

Choose one answer
Check answer and explanation

Correct answer: The validator must perform an asynchronous lookup against the central database because available roles cannot be fetched ahead of time.

Explanation

When the set of valid entries changes continuously and cannot be retrieved upfront, an async validator is needed to query the central database asynchronously.

Common trap

Synchronous validators are routinely attached to reactive FormControl instances; they just cannot wait for remote database lookups. Async validators do not automatically persist results in localStorage; they simply allow asynchronous validation checks.

Source: Angular docs: Validating form input — Implementing a custom async validator
Checked against the cited text on 2026-11-25.

Report an error in this question

Open this question on its own page


NG.VI · Angular 22 practice question

A developer is converting a template-driven form that used required and minlength attributes into a reactive form. How are those same built-in validators accessed in a reactive form?

Choose one answer
Check answer and explanation

Correct answer: As functions on the Validators class

Explanation

The same built-in validators available as HTML attributes in template-driven forms, such as required and minlength, are provided as functions on the Validators class for reactive forms.

Common trap

Validators are not pipes; they are functions attached to controls in the form model. The FormGroup constructor does not take boolean flags like required or minlength for individual controls.

Source: Angular docs: Validating form input — Built-in validator functions
Checked against the cited text on 2026-11-25.

Report an error in this question

Open this question on its own page


NG.VI · Angular 22 practice question

A developer is designing a data model for Signal Forms and considers using custom class instances and Map objects for nested sections. What does Signal Forms require for the structural layer it walks to build the field tree?

Choose one answer
Check answer and explanation

Correct answer: Plain JavaScript objects and arrays

Explanation

Signal Forms walks the model's structural layer to construct the field tree, and that layer must consist of plain JavaScript objects and arrays.

Common trap

FormGroup and FormArray belong to classic reactive forms, not the structural layer of a Signal Forms model. Map and Set collections are not plain JavaScript objects or arrays, so they do not satisfy the structural layer requirement.

Source: Angular docs: Form models — Supported model structures
Checked against the cited text on 2026-11-25.

Report an error in this question

Open this question on its own page


NG.VI · Angular 22 practice question

A team is evaluating Signal Forms to reduce boilerplate in a data-heavy application. Which two capabilities does Signal Forms provide to address form-management complexity?

Choose one answer
Check answer and explanation

Correct answer: Automatic synchronization between the data model and bound fields, and fully type-safe schemas and bindings

Explanation

Signal Forms reduces boilerplate by automatically synchronizing the form data model with bound form fields and supporting fully type-safe schemas and bindings between UI controls and the data model.

Common trap

REST endpoint generation and IndexedDB persistence are outside the scope of Signal Forms. Server-side HTML table rendering and CSS grid layout are unrelated to Signal Forms' state synchronization and type safety.

Source: Angular docs: guide/forms/signals/overview — Why Signal Forms?
Checked against the cited text on 2026-11-25.

Report an error in this question

Open this question on its own page


NG.VI · Angular 22 practice question

A team migrating to Signal Forms needs to check whether a specific field currently has validation errors. Where does Signal Forms expose that validation state?

Choose one answer
Check answer and explanation

Correct answer: Through field state signals such as valid(), invalid(), and errors()

Explanation

Because Signal Forms runs validation rules entirely inside Angular, it exposes validation state through field state signals like valid(), invalid(), and errors().

Common trap

The native DOM element's validity property is not used because Signal Forms does not rely on browser constraint validation. An RxJS statusChanges observable is a classic reactive forms pattern, whereas Signal Forms exposes validation state through field state signals.

Source: Angular docs: Validation — Native HTML validation
Checked against the cited text on 2026-11-25.

Report an error in this question

Open this question on its own page


NG.VI · Angular 22 practice question

A developer is modeling a multi-section profile form with Angular reactive forms and wants to organize related fields together. What kinds of children can a FormGroup accept?

Choose one answer
Check answer and explanation

Correct answer: Both individual form control instances and other form group instances

Explanation

A FormGroup can contain both individual form control instances and nested form group instances as children, making complex form models easier to organize.

Common trap

Restricting FormGroup to only FormControl instances is incorrect because FormGroup explicitly supports nesting other FormGroup instances without needing a FormArray. Requiring a FormRecord for leaf fields is a misconception; FormGroup directly accepts both individual controls and nested groups.

Source: Angular docs: Reactive forms — Creating nested form groups
Checked against the cited text on 2026-11-25.

Report an error in this question

Open this question on its own page


NG.VI · Angular 22 practice question

A developer notices that Signal Forms ignores browser-native constraint validation on standard input elements. Why is Signal Forms designed this way?

Choose one answer
Check answer and explanation

Correct answer: It enables any Angular component to serve as a form control rather than restricting controls to native HTML elements.

Explanation

Signal Forms intentionally skips browser constraint validation so that any Angular component can function as a form control, not only built-in HTML form elements.

Common trap

Performance overhead from DOM mutation observers sounds plausible, but the design decision is about supporting arbitrary components as controls rather than observer cost. Conflicts with template-driven directives are unrelated; Signal Forms bypasses native constraint validation to support custom component controls.

Source: Angular docs: Validation — Native HTML validation
Checked against the cited text on 2026-11-25.

Report an error in this question

Open this question on its own page


NG.VI · Angular 22 practice question

In a Signal Forms model, what value types are supported at the leaves (positions without nested fields)?

Choose one answer
Check answer and explanation

Correct answer: Usually primitives or null, plus Date for native date/month/time/week inputs and any type understood by a custom control

Explanation

Leaf values in Signal Forms are typically primitives (strings, numbers, booleans) or null, with Date also supported by native date, month, time, and week inputs, and custom controls able to accept any type they understand.

Common trap

Booleans and null are valid primitive/leaf values in Signal Forms models rather than being rejected. FieldState is the object returned when reading a field, not a requirement placed on leaf values in the model.

Source: Angular docs: Form models — Supported model structures
Checked against the cited text on 2026-11-25.

Report an error in this question

Open this question on its own page


NG.VI · Angular 22 practice question

Given this typed reactive form model, which set of APIs can a developer call directly on the login FormGroup instance to read or update its state?

import { FormControl, FormGroup } from '@angular/forms';

const login = new FormGroup({
  email: new FormControl(''),
  password: new FormControl(''),
});
Choose one answer
Check answer and explanation

Correct answer: login.value, login.controls, and login.patchValue

Explanation

Angular's FormGroup provides APIs such as value, controls, and patchValue for reading values, accessing child controls, and updating the form model.

Common trap

fields, syncModel, and setErrorsOnly are invented names that do not exist on FormGroup. Signal-style callables like model(), state(), and commit() are not FormGroup APIs.

Source: Angular docs: Typed Forms — Overview of Typed Forms
Checked against the cited text on 2026-11-25.

Report an error in this question

Open this question on its own page


NG.VI · Angular 22 practice question

A developer wants to add validation to a field in a reactive form component. What is the recommended three-step sequence?

Choose one answer
Check answer and explanation

Correct answer: Import a validator function, add the validator to the field, and add logic to handle the validation status

Explanation

Adding validation to a reactive form follows three steps: importing a validator function in the component, attaching it to the field, and adding logic to handle the validation status.

Common trap

Using ngModel and reading the DOM validity object does not match the reactive forms validation workflow. Creating a custom directive and registering it in an NgModule is unnecessary for standard reactive form validation.

Source: Angular docs: Reactive forms — Validating form input
Checked against the cited text on 2026-11-25.

Report an error in this question

Open this question on its own page


NG.VI · Angular 22 practice question

A developer is working with a Signal Forms field tree in a template and wants to retrieve the FieldState object for an individual field. How is that FieldState object obtained?

Choose one answer
Check answer and explanation

Correct answer: By calling the field as a function

Explanation

In Signal Forms, every field in the field tree is a function, and invoking that function returns the field's FieldState object.

Common trap

Reading a .state property is a common guess, but Signal Forms fields are functions that must be called to obtain FieldState. FieldState is retrieved by invoking the field function rather than through dependency injection with inject().

Source: Angular docs: Form models — Reading from field state
Checked against the cited text on 2026-11-25.

Report an error in this question

Open this question on its own page


NG.VI · Angular 22 practice question

A developer is writing a class-based custom asynchronous validator named UniqueRoleValidator in Angular. Which interface should the class implement?

Choose one answer
Check answer and explanation

Correct answer: AsyncValidator

Explanation

A class-based asynchronous validator such as UniqueRoleValidator implements the AsyncValidator interface.

Common trap

Validator is the interface for synchronous class-based validators, not asynchronous ones. AsyncValidatorFn is a function type signature rather than the interface implemented by a validator class.

Source: Angular docs: Validating form input — Implementing a custom async validator
Checked against the cited text on 2026-11-25.

Report an error in this question

Open this question on its own page


Back to all topics