I'm trying to get the index of an item in a database query, but for some reason I'm getting **-1** when trying to use `indexOf` on the data.

The data is displayed in a `md-select` that repeats over a collection of objects (roles):

```
<div layout="row">
    <md-input-container>
        <label>Job Activity:</label>
        <md-select ng-model="activity" required>
            <md-option ng-repeat="activity in activities" ng-value="activity">
                {{ activity.Description }}
            </md-option>
        </md-select>
    </md-input-container>
</div>

```

Displaying works absolutely fine, but when I submit the form that the above `md-select` lives in, I simply cannot find the index of the selected activity in the collection of activities / roles, even though it **COMES** from that collection and no manipulation occurs. 

Here is the submit that occurs when the form has been submitted. Role is the `role` that has been selected from the `md-select`:

```
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';
}

```

The above `console.logs` give me this:

[![enter image description here](https://i.stack.imgur.com/KJkWS.png)](https://i.stack.imgur.com/KJkWS.png)

Now I'm not rocket scientist, but those two objects look exactly the same for me. Is there something I'm missing?