Angular: NG01203: No value accessor for form control with name: 'x' (ControlValueAccessor missing)
A form directive (formControlName, ngModel) is on an element or component that Angular cannot read/write values from.
No value accessor for form control with nameNo value accessor for form control with unspecified name attribute Meaning
Angular forms need a ControlValueAccessor. Native inputs have one once FormsModule / ReactiveFormsModule is imported. Custom components must implement ControlValueAccessor and register NG_VALUE_ACCESSOR, and third-party components (Material, PrimeNG) need their own module imported.
Common causes
FormsModuleorReactiveFormsModulenot imported, so native inputs have no accessorformControlName/ngModelplaced on a component that does not implementControlValueAccessorNG_VALUE_ACCESSORprovider missing in a custom control- Wrong element (a
divinstead ofinput) - Library form module not imported
⚡ Quick fix
- Import
ReactiveFormsModuleorFormsModule - Implement
ControlValueAccessorand provideNG_VALUE_ACCESSORwithforwardRef - Put the directive on the real input element
Detailed fix by platform
Angular
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => StarRatingComponent), multi: true }]on the custom control- Check the library docs for the module that provides the accessor
Code examples
Minimal custom control
@Component({
selector: 'app-star-rating', standalone: true,
template: `<button *ngFor="let s of [1,2,3,4,5]" (click)="set(s)">★</button>`,
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => StarRatingComponent), multi: true }],
})
export class StarRatingComponent implements ControlValueAccessor {
value = 0; onChange = (_: number) => {}; onTouched = () => {};
writeValue(v: number) { this.value = v ?? 0; }
registerOnChange(fn: any) { this.onChange = fn; }
registerOnTouched(fn: any) { this.onTouched = fn; }
set(v: number) { this.value = v; this.onChange(v); }
}How to diagnose
- Element — Native input or custom component?
- Module — Forms module imported?
- Accessor — ControlValueAccessor implemented and provided?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Cannot find control with name Angular: Error: Cannot find control with name: 'email' (reactive forms)
- mat-form-field must contain a MatFormFieldControl Angular Material: Error: mat-form-field must contain a MatFormFieldControl
- NG01050 Angular: NG01050: formControlName must be used with a parent formGroup directive
Most viewed in Angular
- NullInjectorError Angular: NullInjectorError: No provider for X!
- NG0100 Angular: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked
- NullInjectorError: No provider for HttpClient! Angular: NullInjectorError: No provider for HttpClient! — provideHttpClient() missing
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 15 Oct 2026