title: cannot assign to 'total' because it is a constant or a read only property for function get total(){}
body: <p>When I use this command <code>ng build --prod</code> in my project show me this error.
  cannot assign to 'total' because it is a constant or a read only property for function get total(){}</p>
  
  <p>My function is:</p>
  
  <pre><code>  get total() {
           return this.products
            .map(p =&gt; p.Unit_price * p.Quantity)
            .reduce((a, b) =&gt; a + b, 0);
        }
  </code></pre>
  
  <p>Html:</p>
  
  <pre><code>&lt;form [formGroup]="addsale" (ngSubmit)="onaddsale()" &gt;
    &lt;div class="row"&gt;
      &lt;div class="input-field col s2" style="float: right;"&gt;
        &lt;label for="total"&gt;Total {{total}} ALL&lt;/label&gt;
        &lt;input formControlName="total" id="total" type="text" class="validate" [value]="total" [(ngModel)]="total"&gt;
      &lt;/div&gt;
      &lt;div class="input-field col s2" style="float: right;"&gt;
        &lt;label for="amount_paid"&gt;Amount Paid:&lt;/label&gt;
        &lt;input formControlName="amount_paid" id="amount_paid" [value]="total" type="text" class="validate" [(ngModel)]="total"&gt;
      &lt;/div&gt;
      &lt;div class="input-field col s2" style="float: right;"&gt;
        &lt;label for="total"&gt;Subtotal&lt;/label&gt;
        &lt;input formControlName="Subtotal" id="Subtotal" type="text" class="validate" [value]="total" [(ngModel)]="total"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Ts form:</p>
  
  <pre><code>   this.addsale = this.fb.group({
        'amount_paid': new FormControl('', Validators.required),
         'Subtotal': new FormControl('', Validators.required),
        'total': new FormControl('', Validators.required)
      });
  </code></pre>
  
  <p>Any idea please?</p>