如果选择其中一个单选按钮,我需要显示一个div。我在想的是:
<body ng-controller="MainCtrl">
<form name="myForm" ng-submit="submitForm()">
<label><input type="radio" name="test" ng-model="radioValue" value="1"/> One</label>
<label><input type="radio" name="test" ng-model="radioValue" value="2"/> Two</label>
<label><input type="radio" name="test" ng-model="radioValue" value="3"/> Three</label>
<div>currently selected: {{radioValue}}</div>
<div ng-show = "{{radioValue}}=='1'">
<p> Metric Test values</p>
<b> Src: Value1 </b>
<b> Metric1: Value2 </b>
<b> Density: Value3 </b>
</div>
<button type="submit">Submit</button>
</form>
</body>
然而,无论是否选择了组合框,我都无法显示div
答案 0 :(得分:2)
删除{{}}
的{{1}} radioValue
,如下所示
ng-show