console
var app = angular.module('app', []);
app.controller('controller', ['$scope', function($scope) {
$scope.a = 'yes';
$scope.b = "女";
$scope.data1 = ['a', 'b', 'c', 'd', 'e'];
$scope.data2 = [{
id: 1,
name: '1111'
},
{
id: 2,
name: '2222'
},
{
id: 3,
name: '3333'
},
{
id: 4,
name: '4444'
}];
$scope.data3 = [{
id: 1,
name: '1111',
key: 'oooo'
},
{
id: 2,
name: '2222',
key: 'oooo'
},
{
id: 3,
name: '3333',
key: 'oooo'
},
{
id: 4,
name: '4444',
key: 'pppp'
}];
}])
<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
<meta charset="UTF-8" />
<title>
Document
</title>
<script src="https://cdn.bootcss.com/angular.js/1.6.4/angular.min.js">
</script>
</head>
<body ng-controller="controller">
<input type="checkbox" ng-model="a" ng-true-value="'yes'" ng-false-value="'no'"
/>
yes
<div>
{{a}}
</div>
<input type="radio" ng-model="b" value="男" />
男
<input type="radio" ng-model="b" value="女" />
女
<div>
{{b}}
</div>
<select ng-model="c" ng-options="txt for txt in data1">
<option value="">
请选择
</option>
</select>
<div>
{{c}}
</div>
<select ng-model="d" ng-options="txt.id as txt.name for txt in data2">
</select>
<div>
{{d}}
</div>
<select ng-model="e" ng-options="txt.id as txt.name group by txt.key for txt in data3">
</select>
<div>
{{e}}
</div>
</body>
</html>