title: IndexOf indicates that an object doesn't exist, even though it should
body: <p>I'm trying to get the index of an item in a database query, but for some reason I'm getting <strong>-1</strong> when trying to use <code>indexOf</code> on the data.</p>
  
  <p>The data is displayed in a <code>md-select</code> that repeats over a collection of objects (roles):</p>
  
  <pre><code>&lt;div layout="row"&gt;
      &lt;md-input-container&gt;
          &lt;label&gt;Job Activity:&lt;/label&gt;
          &lt;md-select ng-model="activity" required&gt;
              &lt;md-option ng-repeat="activity in activities" ng-value="activity"&gt;
                  {{ activity.Description }}
              &lt;/md-option&gt;
          &lt;/md-select&gt;
      &lt;/md-input-container&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Displaying works absolutely fine, but when I submit the form that the above <code>md-select</code> lives in, I simply cannot find the index of the selected activity in the collection of activities / roles, even though it <strong>COMES</strong> from that collection and no manipulation occurs. </p>
  
  <p>Here is the submit that occurs when the form has been submitted. Role is the <code>role</code> that has been selected from the <code>md-select</code>:</p>
  
  <pre><code>vm.submitEmployment = function (role) {  
      console.log(role);
      console.log($scope.activities.indexOf($scope.role));
      console.log($scope.activities);
  
      $scope.data.role = role.Id;
      $scope.data.roleIndex = $scope.activities.indexOf($scope.role);
      $window.location.href = '#!/additionalInformation';
  }
  </code></pre>
  
  <p>The above <code>console.logs</code> give me this:</p>
  
  <p><a href="https://i.stack.imgur.com/KJkWS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KJkWS.png" alt="enter image description here"></a></p>
  
  <p>Now I'm not rocket scientist, but those two objects look exactly the same for me. Is there something I'm missing?</p>