You make a form control invalid by giving it a failing validator (through setValidators, addValidators, or a custom validator function) and then calling updateValueAndValidity(), or by attaching a ValidatorFn at creation time that returns an error object. Setting control.errors directly or calling markAsTouched() will not change the validity status. Angular's validity model is derived, not assigned: the control computes its status from its validators and its child controls whenever validation runs.

That distinction is the one that trips people up most often. Developers coming from other frameworks look for an isValid = false assignment and don't find one, then try to patch errors by hand and watch it get overwritten on the next change detection cycle. This article walks through the mechanisms that actually work, when each one is appropriate, and how to verify the result without guessing.

How validity is actually computed on an Angular control

Every AbstractControl carries an internal status of VALID, INVALID, PENDING, or DISABLED. That status is recalculated by updateValueAndValidity(), which Angular calls automatically when the value changes (unless you pass { onlySelf: true } or { emitEvent: false } in ways that suppress the cascade) and when you call it yourself.

The recalculation does roughly this: it collects the control's synchronous and asynchronous validators, runs each one against the current value and the parent form where applicable, merges any returned error objects into a single errors object, and sets status to INVALID if that object is non-empty. For a FormGroup or FormArray, the aggregate status also depends on descendants, so making a child invalid makes the parent invalid too, all the way up unless you stop the propagation.

Two consequences follow. First, validity is a function of state, so the only durable way to make a control invalid is to change the inputs to that function: the validators or the value. Second, updateValueAndValidity() is the trigger that applies the function immediately rather than waiting for the next user keystroke.

A minimal illustration:

Note that adding a validator does not automatically re-run validation in all Angular versions and configurations; the explicit updateValueAndValidity() call is the reliable pattern. Treat it as mandatory after any validator mutation.

Adding a validator after creation: the standard approach

The most common real-world requirement is conditional validation: a field is optional until a checkbox is ticked, or a second address becomes required when "shipping differs from billing" is selected. The steps below are the dependable sequence.

Prerequisites: you hold a reference to the AbstractControl (from a FormGroup.get(), a FormBuilder result, or a @ViewChild on an NgModel), and the validators you intend to apply are already imported.

1: Define the validator list you want under the new condition, for example [Validators.required, Validators.minLength(8)]. 2: Call control.setValidators(list) to replace the entire set, or control.addValidators(list) to append without disturbing existing ones. setValidators accepts a single function or an array; passing null clears all validators. 3: Call control.updateValueAndValidity(). Without this, the displayed status can lag until the next value change. 4: If the control lives inside a group and you need the group's status refreshed immediately, call updateValueAndValidity() on the group as well, or rely on the default upward propagation from step 3. 5: In the template, bind error messages to control.hasError('required') or similar so the UI reflects the new state.

Success check: log control.status and control.errors right after step 3. You should see 'INVALID' and an object whose keys name the failing validators. If the status is unchanged, the most likely causes are that the new validator passed for the current value (an empty string satisfies minLength but not required, for instance), or that the call was made on a different control instance than the one bound in the template.

When the condition reverts, repeat the process with setValidators(null) (or the original validator array) and updateValueAndValidity() again. Storing the original validator list in a constant prevents drift between the two branches.

One subtlety worth knowing: addValidators and removeValidators exist on AbstractControl in current Angular versions and are convenient, but they mutate the validator array in place. If you reuse a validator array across multiple controls, prefer setValidators with a fresh copy to avoid shared-state surprises.

Forcing invalidity with a custom validator

Sometimes no built-in validator expresses the rule. A cross-field check ("confirm password must match"), a server-driven business rule ("this SKU is discontinued"), or a value that fails an external constraint all call for a ValidatorFn.

A synchronous validator is just a function that takes an AbstractControl and returns either null (valid) or an error object (invalid):

Attach it at creation with new FormControl('', { validators: [forbiddenValue('admin')] }), or later with setValidators plus updateValueAndValidity(). Either way the control becomes INVALID whenever the predicate fires.

For a rule that depends on other controls, read the parent inside the validator. Angular passes the parent as a property on the control, so control.parent?.get('password')?.value is available inside the closure. Place such a validator on the group rather than the individual control when the error should surface at the group level.

To force invalidity unconditionally for a period, such as while a required server check is outstanding, return a fixed error object:

Because the function always returns an error, the control stays INVALID until you remove the validator and call updateValueAndValidity() again. This is the cleanest "make it invalid now" lever Angular offers, because it works through the normal status pipeline and survives change detection.

Asynchronous checks and the PENDING state

When invalidity depends on a server response, an AsyncValidatorFn returns a Promise or Observable of ValidationErrors | null. The control briefly enters PENDING, then settles on VALID or INVALID. Bind your submit button to form.status !== 'VALID' rather than form.invalid if you want to block submission during the pending window, because invalid is false while status is PENDING.

Two caveats matter in practice. Async validators run only after synchronous validators pass, so a control already failing required will not run the async check and will report INVALID with only the synchronous error. And every updateValueAndValidity() invocation re-triggers the async call, so avoid calling it redundantly in tight loops or inside ngDoCheck.

If you want a hard stop regardless of what the server says, combine an always-failing synchronous validator with the async one. The synchronous error short-circuits the async call and guarantees INVALID immediately.

Setting errors directly, and why it usually backfires

You can technically write control.setErrors({ serverRejected: true }), and this does set status to INVALID as a side effect, because setErrors recomputes status from the errors you hand it. It's tempting for one-off cases, and Angular's own docs acknowledge it as a manual override.

The problem is durability. setErrors does not install a validator, so the next call to updateValueAndValidity() — which happens on every value change — recomputes errors from the validator list, which doesn't include your manual entry, and the control flips back to VALID. If you use setErrors, you must either accept that the invalidity lasts only until the next recalculation, or pair it with a validator that reproduces the error, at which point you might as well have written the validator.

A related trap is markAsTouched(), markAsDirty(), and markAllAsTouched(). These affect UI presentation flags only. They do not change validity, and no amount of touching makes an invalid control valid or vice versa. If a form looks like it's failing validation but the status says VALID, check whether the code is confusing touched state with status.

There's one legitimate, contained use for setErrors: reflecting a server-side rejection that has no client-side equivalent, immediately after a failed submit, with the understanding that any subsequent edit clears it. Even then, a dedicated always-failing validator that you add and remove around the request is more predictable and easier to test.

Disabled controls: why an invalid field sometimes reports VALID

A disabled control reports status DISABLED, and a FormGroup ignores disabled children when computing its own validity. So a field that is invalid but disabled will not make the form invalid. This is intended behavior, but it surprises people who disable a field to "lock" it and then find the form submits with bad data still in it.

If the disabled value still matters, validate it before disabling, or keep the control enabled and use readonly in the template to prevent edits while preserving validation. form.getRawValue() includes disabled controls, so any logic that serializes the raw value must apply its own checks.

Template-driven forms, NgModel, and the equivalent controls

With ngModel, you rarely hold a FormControl reference, but you can reach it through NgModel.control or NgForm.controls. The same methods apply. A directive can inject NgControl and call setValidators and updateValueAndValidity on its control property, which is the idiomatic way to build reusable conditional-required directives.

In a template-driven form, the simpler route is often a directive that implements Validator and registers itself with NG_VALIDATORS:

Angular calls validate on the normal validation cycle, so binding [appForbidden]="'admin'" makes the control invalid whenever the value matches, with no manual updateValueAndValidity() needed. This is the most robust pattern for template-driven code because it never depends on imperative refresh calls.

Verifying it worked, and troubleshooting when it doesn't

The reliable check is a three-line assertion after your change: log control.status, control.errors, and control.valid. If status is INVALID, errors should be a non-null object, and valid should be false. Bind a temporary {{ myForm.status }} in the template to confirm what the view sees versus what your service code sees.

Symptom-to-cause mapping, starting with the reversible checks:

Status stays VALID after adding a validator. The validator passes for the current value, or you forgot updateValueAndValidity(). Check errors for a clue; null means nothing failed. Status flips back to VALID a moment later. Something is calling updateValueAndValidity() or resetting the form, or you used setErrors without a backing validator. Trace calls to reset(), which clears errors and status. Parent form is valid while a child is invalid. The child may be disabled, or you passed { onlySelf: true } to the child's update call, which deliberately skips the parent recalculation. Call updateValueAndValidity() on the parent, or drop onlySelf. Template never shows the error. The control may already have been invalid but the message is gated on touched or dirty, which don't change validity. Also confirm the template references the same control instance. Async validator never fires. A synchronous validator is already failing, short-circuiting the async one. Fix the sync error first. Error keys don't match the template. hasError('required') looks for a key literally named required; a custom validator returning { myRule: true } needs hasError('myRule').

Stop and involve a framework or codebase owner when the behavior depends on a shared base form class, a custom ControlValueAccessor, or a state-management layer you don't own. Chasing status bugs through someone else's abstraction without understanding its update triggers tends to produce patches that regress elsewhere.

A straightforward recovery pattern for conditional rules keeps the validator list in one place and derives it from a boolean:

Because the same function produces both branches, the two paths can't drift apart, and the single update call keeps the group in sync.

Version notes and when to reach for a different tool

The API surface here — setValidators, addValidators, updateValueAndValidity, setErrors, ValidatorFn, AsyncValidatorFn, and the NG_VALIDATORS token — has been stable across modern Angular versions, so the patterns above transfer without much friction. What changes between versions is minor: the exact validation timing within a change detection pass, the availability of typed forms (introduced in Angular 14, where FormControl gives you compile-time value typing but doesn't alter runtime validity), and small refinements to how standalone components interact with form directives. If you're on a version older than the typed forms release, the runtime mechanics are the same; only your TypeScript types differ.

If your rule is really about presentation ("show this field as an error until the user fixes it"), and not about whether the form can be submitted, a CSS class driven by touched and invalid is the right tool, and you shouldn't be mutating validators at all. Separate the question "can this be submitted" from "does this look wrong right now" and most of the confusion dissolves.

The short version to keep: validity in Angular is computed from validators and child controls, so install a validator that fails for the condition you care about and call updateValueAndValidity(). Everything else — setErrors, touched flags, disabled states — is either a temporary side channel or a different feature entirely.