本文介绍了切换按钮没有与AngularJS和角度UI Bootsrap工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的切换按钮出现,但它不工作。我在网上得到了相同的code现在也和它不工作,但在Plunker其工作正常。

The toggle button appears but it is not working. I've got a same code now in online as well and it is not working but in Plunker it is working.

而code是:

<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>

                <div class="nalogo-wrapper">
                    <img class="img-responsive" src="http://placehold.it/50x50&text=Logo" />
                </div>
            </div>
            <div class="collapse navbar-collapse">
                <ul class="nav navbar-nav">
                    <li><a href="#/view1"><span class="glyphicon glyphicon-home"></span> Etusivu</a></li>
                    <li><a href="#/view2">Palvelut</a></li>
                    <li><a href="#/view3">Yhteistiedot</a></li>
                </ul>
            </div><!--/.nav-collapse -->
        </div>
    </div>
    <div id="main">
        <div ng-view>
        </div>
    </div>

感谢您的帮助!
萨米

Thanks for help!Sami

推荐答案

我刚才复制了这一点,我用角UI引导工作项目:

I just copied this out of a working project where I used angular-ui bootstrap:

<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle btn navbar-btn" ng-init="navCollapsed = true"
                    ng-click="navCollapsed = !navCollapsed">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/#">Bake-Off</a>
        </div>
        <div collapse="navCollapsed" class="navbar-collapse collapse navbar-responsive-collapse">
            <ul class="nav navbar-nav">
                <li><a href="#" >Link 1</a></li>
                <li><a href="#" >Link 2</a></li>
                <li></li>
            </ul>
            <div class="container navbar-form navbar-right">

            </div>
        </div>
        <!--/.navbar-collapse -->
    </div>
</div>

这篇关于切换按钮没有与AngularJS和角度UI Bootsrap工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 01:39