私のhtmlコード;
<!doctype html>
<html ng-app ng-controller="peopleController">
<head>
<script src="js/angular.min.js" type="text/javascript"></script>
<script>
function peopleController($scope){
$scope.people = [
{ name : "aa" , age : 14 },
{ name : "ss" , age : 11},
{ name : "dd" , age : 12},
{ name : "ff" , age : 16},
{ name : "gg" , age : 13}
];
$scope.keys=(function(obj){
var keys = [];
for(var key in obj){
console.log(obj);
if(obj.hasOwnProperty(key)){ keys.push(key);}
}
return keys;
})($scope.people[0]);
}
</script>
<title>aasss</title>
</head>
<body >
<select ng-model="aaa">
<option ng-repeat="x in keys" value="{{x}}">{{x}}</option>
</select>
</body>
</html>
select要素の生成されたhtmlパーツ。
<select ng-model="aaa" class="ng-pristine ng-valid">
<option value="? undefined:undefined ?"></option>
<!-- ngRepeat: x in keys -->
<option ng-repeat="x in keys" value="name" class="ng-scope ng-binding">name</option>
<option ng-repeat="x in keys" value="age" class="ng-scope ng-binding">age</option>
</select>
select要素からng-model="aaa"属性を削除しても、問題は発生しません。何が問題なのか?