title: Angular - bind label and text value
body: <p>I have a scenario where I want to bind <code>label.id</code> and the text entered by user to Detail object. I want to dynamically store the label and the entered text. I do not know how I can bind the two values to an object. I know ng-model is used to bind the entered text, but I want to save the label.id corresponding to the entered text.
  If its easier, I  am okay changing datatype of Detail to map instead of array?</p>
  
  <pre><code>&lt;div class="mySettings"    
     ng-show="Id !== undefined"&gt;    
     &lt;section ng-repeat="label in LabelMap[Id].labels"&gt;    
         &lt;label for="{{label.id}}"    
             class="input-field-label"&gt;{{label.value}}&lt;/label&gt;
          &lt;input id="{{label.id}}"    
          ng-model="...." required /&gt;   &lt;!-- add binding here such that myvalue.details.name =  label.id and myvalue.details.value has value text entered--&gt;      
      &lt;/section&gt;
  &lt;div&gt;
  </code></pre>
  
  <p><strong>MyModel.js</strong></p>
  
  <pre><code>export interface MyValue {
       details: Detail[];
  }
  
  export interface Detail {
          name: string;
          value: string;
      }
  </code></pre>