Search code examples
htmlangularjsangular-ui-bootstrapplunker

Dropdown button does work as expected.


I am new to HTML and Angular. This might be simple basic question. I am trying to use the basic dropdown button. in this example.

http://jsfiddle.net/xkL15guj/

I am trying to use the same example in plunkr. However, when I am trying to add the files bootstrap.min.js, I am unable to add. Can you help me understand what mistake I am doing here.

https://plnkr.co/edit/YfgD9G?

<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"/>
 <div class="btn-group">
  <button type="button" class="btn btn-danger">Action</button>
  <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
    <span class="caret"></span>
    <span class="sr-only">Toggle Dropdown</span>
  </button>
  <ul class="dropdown-menu" role="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>

Thank you.


Solution

  • To add bootstrap you need to add jquery:

    When I looked at your plunker, the adjusts you need to made at the top of your script calls (before angular):

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
    

    and

    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
    

    I have a plunker example here: https://plnkr.co/edit/Kpy4s0RdFFu5hqgnKm9h?p=preview

    Also be aware that the bootstrap png you are referencing is "Blocked loading mixed active content"

    Mixed Active Content is now blocked by default in Firefox 23!

    What is Mixed Content?

    When a user visits a page served over HTTP, their connection is open for eavesdropping and man-in-the-middle (MITM) attacks. When a user visits a page served over HTTPS, their connection with the web server is authenticated and encrypted with SSL and hence safeguarded from eavesdroppers and MITM attacks.

    However, if an HTTPS page includes HTTP content, the HTTP portion can be read or modified by attackers, even though the main page is served over HTTPS. When an HTTPS page has HTTP content, we call that content “mixed”. The webpage that the user is visiting is only partially encrypted, since some of the content is retrieved unencrypted over HTTP. The Mixed Content Blocker blocks certain HTTP requests on HTTPS pages.

    To disable blocking mixed content:

    If you need to allow the mixed content to be displayed, you can do that easily:

    Click the shield icon Mixed Content Shield in the address bar and choose Disable Protection on This Page from the dropdown menu.

    The icon in the address bar will change to an orange warning triangle Warning Identity Icon to remind you that insecure content is being displayed.

    To revert the previous action (re-block mixed content), just reload the page.