title: AngularJS md-select Ties two select values together
body: <p>I am trying to create a multi-select in angular where one of the elements in the array being selected from is a clone of another element in the array. This cloned element has some fields changed in it. </p>
  
  <pre><code>&lt;md-select ng-model="$ctrl.modbusMeterDataParameters.points"
             md-on-close="$ctrl.unitSelect()" multiple no-dirty&gt;
    &lt;md-option ng-repeat="point in $ctrl.getPoints()" ng-value="point"&gt;
      {{point.name}}
    &lt;/md-option&gt;
  &lt;/md-select&gt;
  </code></pre>
  
  <p>Originally I was getting a <code>$$hashkey</code> error but I fixed this by adding <code>track by</code> to my <code>md-option</code> tag:</p>
  
  <pre><code>&lt;md-option ng-repeat="point in $ctrl.getPoints() track by point.name"
             ng-value="point"&gt;
      {{point.name}}
  &lt;/md-option&gt;
  </code></pre>
  
  <p>But there is still an angular generated field on the points called <code>$$mdselectid</code> that is the same for the original element and the cloned element. I am creating the cloned element as follows:</p>
  
  <pre><code>this.filteredPoints = this.filterAndSortPoints(this.points);
  const threePhaseDataPoint = _.cloneDeep(this.filteredPoints[0]);
  threePhaseDataPoint.name = this.fullMeterDataLabel;
  this.filteredPoints.push(threePhaseDataPoint);
  </code></pre>
  
  <p>I am currently getting around the problem by doing this:</p>
  
  <pre><code>if (threePhaseDataPoint.$$mdSelectId) {
      threePhaseDataPoint.$$mdSelectId = this.filteredPoints.length * 2;
  }
  </code></pre>
  
  <p>But this seems very hacky. I am wondering if there is a better way to do this?</p>