title: How can I use a Map() inside [(ngModel)]?
body: <p>I'm trying to get a specific value into a map at a specific key. </p>
  
  <p>In my code I use <code>ngFor</code> to loop through the array. The item I get in each iteration should be the key value of the map, while the user input the corresponding value.</p>
  
  <p>IMPORTANT: The variable <code>userInputValue</code> doesn't exist. That's the point of my Question: How do I get the <code>userInputValue</code> so that I can apply it to the map?
  I hope you can undertsand what I mean..</p>
  
  <p>The <code>item</code> is any string for example <code>"Name"</code> and <code>userInputValue</code> would be whatever the user has typed into the <code>input field</code>, how do I get the latter in this case?</p>
  
  <p>In my Component.html</p>
  
  <pre><code>&lt;form *ngFor="let item of myStringArray"&gt;
      &lt;input [(ngModel)]="map.set(item, userInputValue)"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>In my Component.ts</p>
  
  <pre><code>public map = new Map&lt;string, string&gt;();
  
  public myMethod() {
      this.stringInputs.forEach((item) =&gt; {
         this.eintrag.raumgroesseQM = this.map.get(item);
      });
  }
  </code></pre>
  
  <p>Is it possible to use Map in such a fashion, if yes, how can I do it correctly and if no, are there any other ways I could reach this goal (except for making my own class of course)?</p>
  
  <p>My current approach uses delimiter splitting and looks like this:</p>
  
  <pre><code>// the string would be something like: "Name;34"
  
  this.finalInputWithContext.forEach((item) =&gt; {
  
    if (item.split(";")[0] === "Name") {
      concole.log(item.split(";")[1]); // will print 34
    }
  
  });
  </code></pre>
  
  <p>This solution works too of course, however I was told to use a Map instead..</p>