See beneath the examples for the data bound to controls.

Without select-key

<select ng-model="user.role" ng-options="r.name for r in roles">

Here we see a typical problem when pre-selecting a dropdown with data returned from the server. Angular does not match $scope.user.role with the intended role in $scope.roles as it only compares objects by reference.

With select-key

<select ng-model="user.role" key="id" ng-options="r.name for r in roles">

ngyn-select-key adds an attribute to the select element to specify a means to compare the items. This is typically just a property but runs through $scope.$eval so sub-properties such as type.id and functions are also usable

Multi-select with select-key

<select multiple ng-model="advancedUser.roles" key="id" ng-options="r.name for r in roles">

Roles:

{{pp(roles)}}

User:

{{pp(user)}}

Advanced User:

{{pp(advancedUser)}}