Answer the question
In order to leave comments, you need to log in
Angular Select how to get only key value?
There is a form.
<form name="create-workpeople" ng-submit="createWorkpeople()">
<select ng-model="workpeople.workpeopleType" ng-options="workerType.type for workerType in workpeopleType "></select>
</form>
$scope.workpeopleType = [
{type: 'P'},
{type: 'V'},
{type: 'N'},
{type: 'U'}
];
$scope.workpeople.workpeopleType = $scope.workpeopleType[0].type;
{{workpeople | json}}
{
"workpeopleType": "P"
}
<select ng-model="workpeople.workpeopleType" ng-options="workerType.type for workerType in workpeopleType "></select>
"workpeopleType": {
"type": "P"
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question