引导数据触发中断NG-显示,反之亦然 [英] Bootstrap data-toggle breaks ng-show and vice versa

查看:150
本文介绍了引导数据触发中断NG-显示,反之亦然的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用两个单选按钮的形式切换器:

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; D​​IV 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; D​​IV CLASS =无线方式&gt;

删除它们,它应该在这个小提琴

这篇关于引导数据触发中断NG-显示,反之亦然的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆