2

I was successfully using ui-bootstrap's dropdown menu with version 0.11.0 as follows:

<ul class="nav navbar-nav navbar-right">
                        <li class="dropdown">
                            <a href='#' class="dropdown-toggle"><i class="fa fa-cogs"></i> Hi {{"{{user.fName}}"}} !<span class="caret"></span></a>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="settings">My Account</a></li>
                              <!--   <li class="divider"></li> -->
                                <li><button class="btn btn-danger btn-block" onclick="LogOut()">Log Out</button></li>
                            </ul>
                        </li>
                    </ul>

But, I needed to use datepicker's month mode which required me to upgrade to 0.13.3. Here's my other question explaining that. Here's a common plunker.

But, now my dropdown menu has stopped working. On clicking it, no dropdown shows but also there is no error. Any idea how I should tackle this?

3
  • Hi Pierre, I have added a plunker in the question. Can you please help there? Commented Sep 3, 2015 at 13:23
  • 1
    Well, your plunker is working fine. Commented Sep 3, 2015 at 13:35
  • check now I was trying from the docs. Now you'll see the datepickers working properly, but the dropdown isn't. However, if you change the version to 0.11.0, the dropdown will start working but the datepicker would stop working. Commented Sep 3, 2015 at 13:36

2 Answers 2

3

To fix this, you have to use the directive dropdown, not only the class.

 <li class="dropdown" dropdown>
      <a class="dropdown-toggle" dropdown-toggle>
             <i class="fa fa-cogs"></i> Hi !
             <span class="caret"></span>
      </a>
      <ul class="dropdown-menu" role="menu">
          <li><a href="settings">My Account</a></li>
          <!--   <li class="divider"></li> -->
          <li><button class="btn btn-danger btn-block" onclick="LogOut()">Log Out</button></li>
       </ul>
 </li>

Simply add dropdown and dropdown-toggle on your HTML tag will do the trick.

Working Plunker

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

3 Comments

Yes, it seems 0.11.0 supports not adding a directive and works with just a class.
To be honest, I don't know the fact that it was even possible to use only the class.
yes, its funny but it was working with just a class in the 0.11.0 version.
0

As suggested by Pierre, I had to add attributes 'dropdown' and 'dropdown-toggle' rather than classes in version 0.13.3 as compared to 0.11.0. Changing the markup from:

<ul class="nav navbar-nav navbar-right">
                        <li class="dropdown">
                            <a href='#' class="dropdown-toggle"><i class="fa fa-cogs"></i> Hi  !<span class="caret"></span></a>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="settings">My Account</a></li>
                              <!--   <li class="divider"></li> -->
                                <li><button class="btn btn-danger btn-block" onclick="LogOut()">Log Out</button></li>
                            </ul>
                    </li>
                </ul>

to

<ul class="nav navbar-nav navbar-right">
                          <li dropdown>
                            <a href='#' dropdown-toggle><i class="fa fa-cogs"></i> Hi {{"{{user.fName}}"}} !<span class="caret"></span></a>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="settings">My Account</a></li>
                              <!--   <li class="divider"></li> -->
                                <li><button class="btn btn-danger btn-block" onclick="LogOut()">Log Out</button></li>
                            </ul>
                        </li>
                    </ul>

did the trick.

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.