<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<pre>{{selectedNames}}</pre>
<div ng-repeat="item in names track by $index">
<select ng-model="selectedNames[$index]" ng-options="(x.name +','+x.age) as key for (key, x) in names">
</select>
</div>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.names = {
any: {
name: 'one',
age: 12
},
request_type: {
name: 'two',
age: 13
},
remote_type: {
name: 'three',
age: 14
}
};
$scope.selectedNames = [];
});
</script>
<p>This example shows how to fill a dropdown list using the ng-options directive.</p>
</body>
</html>
// Code goes here
/* Styles go here */