title: If ngModel is used within a form tag, either the name attribute must be set or the form control must be defined as ‘standalone’ in ngModelOptions
body: <p>I use angular 9. my aim  when i click in login button iit redirect me
  to dashboard if login is success,otherwise it redirectme to login
  page.  when i enter my username and pasword and click on login button
  it show an error  If ngModel is used within a form tag, either the
  name attribute must be set or the form control must be defined as
  ‘standalone’ in ngModelOptions</p>
  
  <pre><code>tag, either the name attribute must be set or the form
        control must be defined as 'standalone' in ngModelOptions.
  
        Example 1: &lt;input [(ngModel)]="person.firstName" name="first"&gt;
        Example 2: &lt;input [(ngModel)]="person.firstName" [ngModelOptions]="{standalone: true}"&gt;
       at Function.push../node_modules/@angular/forms/fesm5/forms.js.TemplateDrivenErrors.missingNameException
  (forms.js:4830)
      at NgModel.push../node_modules/@angular/forms/fesm5/forms.js.NgModel._checkName
  (forms.js:5158)
      at NgModel.push../node_modules/@angular/forms/fesm5/forms.js.NgModel._checkForErrors
  (forms.js:5143)
      at NgModel.push../node_modules/@angular/forms/fesm5/forms.js.NgModel.ngOnChanges
  (forms.js:5046)
      at checkAndUpdateDirectiveInline (core.js:22777)
      at checkAndUpdateNodeInline (core.js:31612)
      at checkAndUpdateNode (core.js:31574)     at debugCheckAndUpdateNode (core.js:32211)
      at debugCheckDirectivesFn (core.js:32171)
      at Object.eval [as updateDirectives] (LoginComponent.html:16) View_LoginComponent_0 @ LoginComponent.html:15 LoginComponent.html:16
  ERROR CONTEXT DebugContext_
  loginc.component.html
  </code></pre>
  
  <hr>
  
  <p><em>Code</em></p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div class="app-body"&gt;
      &lt;main class="main d-flex align-items-center"&gt;
          &lt;div class="container"&gt;
              &lt;div class="row"&gt;
              &lt;div class="col-md-8 mx-auto"&gt;
                  &lt;div class="card-group"&gt;
                  &lt;div class="card p-4"&gt;
                      &lt;div class="card-body"&gt;
                      &lt;form&gt;
                          &lt;h1&gt;Login&lt;/h1&gt;
                          &lt;p class="text-muted"&gt;Sign In to your account&lt;/p&gt;
                          &lt;div class="input-group mb-3"&gt;
                          &lt;div class="input-group-prepend"&gt;
                              &lt;span class="input-group-text"&gt;&lt;i class="icon-user"&gt;&lt;/i&gt;&lt;/span&gt;
                          &lt;/div&gt;
                          &lt;input type="text" class="form-control" placeholder="Username" [(ngModel)]="username" autocomplete="username" required&gt;
                          &lt;/div&gt;
                          &lt;div class="input-group mb-4"&gt;
                          &lt;div class="input-group-prepend"&gt;
                              &lt;span class="input-group-text"&gt;&lt;i class="icon-lock"&gt;&lt;/i&gt;&lt;/span&gt;
                          &lt;/div&gt;
                          &lt;input type="password" class="form-control" placeholder="Password"[(ngModel)]="password" autocomplete="current-password" required&gt;
                          &lt;/div&gt;
                          &lt;div class="row"&gt;
                          &lt;div class="col-6"&gt;
                              &lt;button type="button" (click)=dologin class="btn btn-primary px-4"&gt;Login&lt;/button&gt;
                          &lt;/div&gt;
                          &lt;div class="col-6 text-right"&gt;
                              &lt;button type="button" class="btn btn-link px-0"&gt;Forgot password?&lt;/button&gt;
                          &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/form&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="card text-white bg-primary py-5 d-md-down-none" style="width:44%"&gt;
                      &lt;div class="card-body text-center"&gt;
                      &lt;div&gt;
                          &lt;h2&gt;Sign up&lt;/h2&gt;
                          &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.&lt;/p&gt;
                          &lt;button type="button" class="btn btn-primary active mt-3"&gt;Register Now!&lt;/button&gt;
                      &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/main&gt;
  &lt;/div&gt;
  </code></pre>