Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS and Bootstrap's split button dropdown

Do you know if someone ported Bootstrap's scripts to AngularJS?

I need Bootstrap's split button dropdown for my app and I'd really like to avoid pulling jQuery in. I seem to fail to google this out.

like image 256
minder Avatar asked Oct 21 '12 18:10

minder


1 Answers

Look at this demo : http://jsfiddle.net/guillaumebiton/8muRC/

Only the power of Angular:

<div class="btn-group" ng-class='{open: open}'>
    <button class="btn">Action</button>
    <button class="btn dropdown-toggle" data-toggle="dropdown" ng-click='open=!open'>
        <span class="caret"></span>
    </button>
    <ul class="dropdown-menu">
        <li><a href="#">Action</a></li>
        <li><a href="#">Another action</a></li>
        <li><a href="#">Something else here</a></li>
        <li class="divider"></li>
        <li><a href="#">Separated link</a></li>
    </ul>
</div>

It only use one variable 'open' which is true or false.

like image 108
Guillaume Avatar answered Sep 18 '22 14:09

Guillaume