如何在控制器中选择'是'用户开始输入密码字段时的选项按钮?
<!-- views/index.html -->
<label for="optionsRadios1">
<input type="radio" name="optionsRadios" id="optionsRadios1" value="new" ng-model="user.type" checked>
No, I am a <b>new customer</b>.
</label>
<label>
<input type="radio" name="optionsRadios" id="optionsRadios2" value="old" ng-model="user.type">
Yes, I have a password:
<input id="password" ng-change="changeupinhere()" ng-model="password2014" type="password" name="password">
</label>
$scope.changeupinhere = function () {
// What do I put here?
};
答案 0 :(得分:0)
$scope.changeupinhere = function () {
$scope.user.type = 'old';
};