根据所选的单选按钮显示文本字段。现在我将其更改为复选框,它不起作用。任何帮助请。
<body ng-app="EquityCompensation">
<script src="https://code.angularjs.org/1.4.3/angular.js"></script>
<script src="https://code.angularjs.org/1.4.3/angular-route.js"></script>
<script src="app.js"></script>
<div ng-controller="MainCtrl">
<div data-ng-repeat="choic in choice">
<form>
<input ng-model="choic.mustShow" class="label_align" type="checkbox" name="customer" value="no">
<div class="mediumSubhead"> Information housed </div>
<br/>
<input ng-model="choic.mustShow" class="label_align" type="checkbox" name="customer" value="yes">
<div class="mediumSubhead"> Information housed outside </div>
</form>
</div>
<div ng-show="(choice | filter: {mustShow: 'yes'}).length > 0">
<input name="first_name" class="text_box_space" type="text" value="" style="color: black;" size="25" width="200px">
</div>
</div>
</body>
var app = angular.module('EquityCompensation', []);
app.controller('MainCtrl', function($scope) {
$scope.choice = [{id: 'choic1'},{id: 'choic2'}];
});
答案 0 :(得分:0)
ng-true-value =“'YES'”ng-false-value =“'NO'”使用此属性&amp;它起作用了