Uncaught Error: Cannot assign to a reference or > variable! > at _AstToIrVisitor.visitPropertyWrite : <p>I was following an example from angular.io website of creating a form in angular with an input but I am stuck at an error:</p>

<blockquote>
  <p>compiler.js:26390 Uncaught Error: Cannot assign to a reference or
  variable!
      at _AstToIrVisitor.visitPropertyWrite (webpack-internal:///./node_modules/@angular/compiler/esm5/compiler.js:26611:23)
      at PropertyWrite.visit (webpack-internal:///./node_modules/@angular/compiler/esm5/compiler.js:4900:24)
      at convertActionBinding (webpack-internal:///./node_modules/@angular/compiler/esm5/compiler.js:26035:45)
      at eval (webpack-internal:///./node_modules/@angular/compiler/esm5/compiler.js:28635:22)
      at Array.forEach ()
      at ViewBuilder._createElementHandleEventFn (webpack-internal:///./node_modules/@angular/compiler/esm5/compiler.js:28631:18)
      at nodes.(anonymous function) (webpack-internal:///./node_modules/@angular/compiler/esm5/compiler.js:28050:27)
      at eval (webpack-internal:///./node_modules/@angular/compiler/esm5/compiler.js:28576:22)
      at Array.map ()
      at ViewBuilder._createNodeExpressions (webpack-internal:///./node_modules/@angular/compiler/esm5/compiler.js:28575:56)</p>
</blockquote>

<p>The only change I made was renaming the "name" to "username". </p>

<p>dashboard.component.ts</p>

<pre><code>import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-dashboard',
  templateUrl: './dashboard.component.html',
  styleUrls: ['./dashboard.component.css']
})
export class DashboardComponent implements OnInit {

  username: string;
  submitted = false;

  constructor() { 
  }

  ngOnInit() {
  }

  onSubmit() { this.submitted = true; }

}
</code></pre>

<p>dashboard.component.html</p>

<pre><code>&lt;div class="row justify-content-md-center"&gt;
    &lt;div class="col col-lg-12"&gt;
      &lt;form (ngSubmit)="onSubmit()" #usernameForm="ngForm" &gt;
        &lt;div class="form-group"&gt;
          &lt;label for="username"&gt;Name&lt;/label&gt;                    

          &lt;input type="text" class="form-control" id="name"
          required
          [(ngModel)]="username" name="name"
          #username="ngModel"&gt;

          &lt;div [hidden]="username.valid || username.pristine"
              class="alert alert-danger"&gt;
            Name is required
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;button type="submit" class="btn btn-success"&gt;Submit&lt;/button&gt;
      &lt;/form&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>What's wrong in the above code?</p>
