1

I'm trying to use dropdown button in my project but I can't do it. I run the command:

npm install angular-ui-bootstrap

After this, I included:

angular.module('myModule', ['ui.bootstrap',
   ...
])

Finally in my page:

<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="dropdown-menu" 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>

The dropdown button doesn't work. Is there anything to include after installing ui-bootstrap? Thanks

2

1 Answer 1

0

you must first add bootstrap.js and bootstrap.css and then add ui.bootstrap.css angular-animate.js and angular.touch.js. .then add ngAnimate and angular-touch dependencies before ui.bootstrap

angular.module('myModule', ['ngAnimate','angular-touch','ui.bootstrap',...

he only required dependencies are:

AngularJS (requires AngularJS 1.4.x or higher, tested with 1.6.1). 0.14.3 is the last version of this library that supports AngularJS 1.3.x and 0.12.0 is the last version that supports AngularJS 1.2.x. Angular-animate (the version should match with your angular's, tested with 1.6.1) if you plan in using animations, you need to load angular-animate as well. Angular-touch (the version should match with your angular's, tested with 1.6.1) if you plan in using swipe actions, you need to load angular-touch as well. Bootstrap CSS (tested with version 3.3.7). This version of the library (2.5.0) works only with Bootstrap CSS in version 3.x. 0.8.0 is the last version of this library that supports Bootstrap CSS

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.