我正在尝试ngOptions
与track by
这是我的模板
<select ng-model="asd" ng-options="user.id as user.name for user in users track by user.id | orderBy: 'name'">
这是我的控制器
function AppCtrl($scope) {
$scope.users = [
{id : 25, name: 'Batista'},
{id : 26, name: 'Ultimate Warrior'},
{id : 27, name: 'Andre the giant'}
];
$scope.name = 'asdasd';
$scope.asd = 25;
}