# Angular: NG01352: If ngModel is used within a form tag, either the name attribute must be set or the form control must be defined as 'standalone'

**Code:** `NG01352` · **Category:** Angular · **Seen on:** Angular, TypeScript

An `[(ngModel)]` input sits inside a `<form>` but has no `name`, so Angular cannot register it as a form control.

## Meaning

In template-driven forms every `ngModel` inside a `<form>` registers under its `name` attribute. Add a `name`, or tell Angular the control is not part of the form with `[ngModelOptions]="{standalone: true}"`.

## Common causes

- `[(ngModel)]` inside `<form>` without a `name` attribute
- Dynamic `name` bound after render (`[name]` empty)
- ngModel used on buttons or helper inputs that should not join the form
- Copied input from outside a form into a form

## Quick fix

1. Add `name="field"` to every ngModel inside the form
2. Use `[ngModelOptions]="{standalone: true}"` for helper controls
3. Switch to reactive forms for complex forms

## Detailed fix by platform

### Angular

1. `<input name="email" [(ngModel)]="user.email">`
2. Helper input: `<input [(ngModel)]="filter" [ngModelOptions]="{standalone: true}">`

## Code examples

### name or standalone

```html
<form #f="ngForm">
  <input name="email" [(ngModel)]="user.email" required>
  <input [(ngModel)]="search" [ngModelOptions]="{standalone: true}">   <!-- not part of the form -->
</form>
```

## How to diagnose

1. **Element** — Which ngModel is missing a name?
2. **Binding** — Is name bound dynamically?
3. **Intent** — Should it join the form?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/angular/ng01352-ngmodel-needs-name-in-form)
