Using ui-select, I have list of personels and want to show that in with ui-select
by this way:
(function() {
'use strict';
angular
.module('framework')
.controller('UserDetailController', UserDetailController);
function UserDetailController(BasePersonel) {
var vm = this;
vm.basePersonels = BasePersonel.all();
}
})();
<ui-select ng-model="vm.basePersonelId" >
<ui-select-match>
<span ng-bind="$select.selected.entityTitle"></span>
</ui-select-match>
<ui-select-choices repeat="item in (vm.basePersonels | filter: $select.search) track by item.id">
<span ng-bind="item.entityTitle"></span>
</ui-select-choices>
</ui-select>
But I want to set id
of the selected object into vm.basePersonelId
instead of the whole object.
How can i do that?