我試圖用下拉選項「是/否」替換爲true和false,以便我可以使用ng-hide來使輸入字段的外觀變爲動態。但綁定不能按要求工作。請檢查JS bin鏈接https://jsbin.com/piteqoduba/1/edit?html,output並提供建議。替換Angular.js中的select選項
<div ng-app="myApp" ng-controller="myCtrl">
<p>Delivery to same address?</p>
<ng-int="selectedVal={range.value}"></ng-int>
<select ng-model="selectedVal" ng-options="range.display for range in range" >
</select>
<p ng-hide= "selectedVal" >Fill your address below.</p>
<input type="text" ng-hide = "selectedVal">
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.range = [{display: "yes", value:true},
{display: "no", value: false}
];
});
</script>
感謝Avnesh的格式。 – Vikas2612