ng-model指明双向绑定数据;ng-value指明单选按钮值,可动态修改;{{ }}相当于ng-bind,指数据单向绑定
<html ng-app="notesApp">
<head>
<meta charset="utf-8">
<title>Notes App</title>
</head>
<body ng-controller="MainCtrl as ctrl">
<div>
<input type="radio"
name="gender"
ng-model="ctrl.user.gender"
ng-value="ctrl.genderV.male">{{ctrl.genderV.male}}
<input type="radio"
name="gender"
ng-model="ctrl.user.gender"
ng-value="ctrl.genderV.female">{{ctrl.genderV.female}}
<input type="radio"
name="gender"
ng-model="ctrl.user.gender"
ng-value="ctrl.genderV.gel">{{ctrl.genderV.gel}}
</div>
<script src="angular.min.js"></script>
<script>
angular.module('notesApp',[])
.controller('MainCtrl',[function(){
var self = this;
this.user = {gender: '男'};
this.genderV = {male:'男',female:'女',gel:'中性'}
}]);
</script>
</body>
</html>