7

I have copied code directly form the Angular Bootstrap UI Plunkr

I am using a blank Angular FullStack (Mean) template for building an application.

When I use the code from the Angular Bootstrap uib-dropdown it ends up formatted incorrectly and does not work, all other angular bootstrap components seem to work fine

<!-- Single button -->
<div class="btn-group" uib-dropdown is-open="status.isopen">
  <button id="single-button" type="button" class="btn btn-primary" uib-dropdown-toggle ng-disabled="disabled">
    Button dropdown <span class="caret"></span>
  </button>
  <ul class="uib-dropdown-menu" role="menu" aria-labelledby="single-button">
    <li role="menuitem"><a href="#">Action</a></li>
    <li role="menuitem"><a href="#">Another action</a></li>
    <li role="menuitem"><a href="#">Something else here</a></li>
    <li class="divider"></li>
    <li role="menuitem"><a href="#">Separated link</a></li>
  </ul>
</div>

How it Looks in Angular FullStack

David Cruwys
  • 6,262
  • 12
  • 45
  • 91

4 Answers4

11

Upgrade Angular UI in bower.json:

"angular-bootstrap": "~0.14.3",

Then run:

bower install
mooses
  • 558
  • 6
  • 9
7

I have solved my problem by not using the Angular Bootstrap Dropdown directive and gone with Bootstrap + Plain Old Angular code which I googled.

This is working fine for me.

    <div class="input-group">
        <div class="btn-group" ng-class='{open: open}'>
            <button class="btn btn-primary dropdown-toggle"
                    data-toggle="dropdown"
                    ng-click='open=!open'>
                Action<span class="caret"></span>
            </button>
            <ul class="dropdown-menu">
                <li ng-repeat="choice in ['the', 'quick', 'brown', 'fox']"
                    ng-click="setChoiceIndex($index);$parent.open =!$parent.open">
                    <a href="#">{{choice}}</a>
                </li>
            </ul>
        </div>
    </div>
David Cruwys
  • 6,262
  • 12
  • 45
  • 91
1

I had this problem. I updated Angular UI Bootstrap to 0.14.3 version & then resolved the problem.

Mohammad Hossein Gerami
  • 1,360
  • 1
  • 10
  • 26
0

You should use 'uib-' prefix for each directive, check this answer: https://stackoverflow.com/a/34725928/3439101

Community
  • 1
  • 1
Edan Chetrit
  • 4,713
  • 2
  • 20
  • 20