引导数据触发中断NG-显示,反之亦然 [英] Bootstrap data-toggle breaks ng-show and vice versa
问题描述
我用两个单选按钮的形式切换器:
I have a form switcher using two radio buttons:
<form>
<div class="btn-group">
<div class="radio">
<label class="btn btn-info">
<input type="radio" name="formSwitcher" id="gNr" ng-model="vm.formSwitcher" value="gNr" /> Form for new G
</label>
</div>
<div class="radio">
<label class="btn btn-info">
<input type="radio" name="formSwitcher" id="pNr" ng-model="vm.formSwitcher" value="pNr" /> Form for new P
</label>
</div>
</div>
</form>
<div ng-show="vm.formSwitcher == 'gNr' ">
<form> ... </form>
</div>
<div ng-show="vm.formSwitcher == 'pNr' ">
<form> ... </form>
</div>
这是按预期工作,我选择一个单选按钮,相应的表格显示/隐藏相应地。
This is working as expected, I choose a radio button and the appropriate forms show/hide accordingly.
当我加入数据切换=按钮
上面的2号线,&LT; DIV CLASS =BTN-组&GT;
的 NG-隐藏
停止工作,但在视觉状态的变化(出现pressed或取消pressed)工作正常。
When I add data-toggle="buttons"
to the 2nd line above, <div class="btn-group">
, the ng-hide
stops working BUT the change in visual state (appearing pressed or unpressed) works fine.
<div class="btn-group" data-toggle="buttons">
当我删除数据切换
我没有得到的按钮颜色的变化,以显示该电台的选择(单选黑点仍显示正确) 。
When I remove the data-toggle
I don't get the variation in button color to show which of the radios is selected (the radio black dot still appears correctly).
为什么会数据切换=按钮
停止 NG-节目
从工作吗?客户希望看到选择按钮/收音机改变颜色。
Why would data-toggle="buttons"
stop ng-show
from working? The customer wants to see the button/radio change color on select.
推荐答案
您有多余的&LT; DIV CLASS =无线方式&gt;
删除它们,它应该在这个小提琴。
这篇关于引导数据触发中断NG-显示,反之亦然的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!