title: Angular/Typescript Change values of a number array
body: <p>I get the Object essensplan</p>
  
  <pre><code>  const essensplan = [
   { id: 1, essenProWoche: [11, 14, 17, 20, 12] },
   ...
   { id: 8, essenProWoche: [15, 14, 13, 12, 11] }
    ];
  </code></pre>
  
  <p>from an emulated server and I want the possibility for the user to change each value of the array essenProWoche
  and give it back to the server. </p>
  
  <p>I tried </p>
  
  <pre><code>    &lt;div&gt;
       &lt;label&gt;Änderungen:
          &lt;input [(ngModel)]="essensplan.essenProWoche"     placeholder="Name"&gt;
       &lt;/label&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>which doesn't work because it's not returned as an array </p>
  
  <p>and</p>
  
  <pre><code> &lt;label *ngFor="let id of essensplan.essenProWoche; let i = index"&gt;
      &lt;input type="number"  [(ngModel)]="essensplan.essenProWoche[i]"&gt;
    &lt;/label&gt;
  </code></pre>
  
  <p>which changes the values live in the browser, but they are not saved.</p>
  
  <p>I save the inputs by the following functions:</p>
  
  <p>essensplan-detail.component.ts</p>
  
  <pre><code>save(): void {
  this.essensplanService.updateEssensplan(this.essensplan)
    .subscribe(() =&gt; this.goBack());
    }
  </code></pre>
  
  <p>essensplan.service.ts </p>
  
  <pre><code> updateEssensplan(essensplan: Essensplan): Observable&lt;any&gt; {
   return this.http.put(this.speisekarteUrl, essensplan, httpOptions).pipe(
   tap(_ =&gt; this.log(`updated essensplan id=${essensplan.id}`)),
   catchError(this.handleError&lt;any&gt;('updateEssensplan'))
  </code></pre>