I am working on angularjs , Where I need to set selected item by name in selected item.

How DO i do that . I can set item by index but how do i do with itemname

Eg : on load I am setting 1st item as selected item

```
$scope.internalRoles = data;
                $scope.internalItemSelected = $scope.internalRoles[0];

```

and Data is like 

```
 data = [{id : 1 , roleName : "admin"}
,{id : 2 , roleName : "superadmin"}]

```

Now I want to set selected item on basis on roleName

```
$scope.internalItemSelected =  $scope.internalRoles["superadmin"] ;//based on roleName

```

But its not working.

How do i set it by name ?