Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am using wrapbootstrap theme - ace.

I have html page using angularjs using yeoman, karma and grunt. There I am using the ace theme. The angularjs is working fine for me. But the wrapbootstrap theme is not working properly. Some Jquery works, but some not. Here is my index.html page structure.

<html>
<head>
<!-- CSS imports -->
</head>
<body ng-app="MyApp">
<div class="navbar">
 <!--  Page top header and left side menus -->
 <div ng=view="">
 </div>
</div>
<!-- basic scripts -->

    <!--[if !IE]> -->

    <script type="text/javascript">
        window.jQuery || document.write("<script src='styles/assets/js/jquery-2.0.3.min.js'>"+"<"+"/script>");
    </script>

    <!-- <![endif]-->

    <!-- [if IE]> -->
    <script type="text/javascript">
     window.jQuery || document.write("<script src='styles/assets/js/jquery-1.10.2.min.js'>"+"<"+"/script>");
    </script>
    <!-- <![endif] -->

    <script type="text/javascript">
        if("ontouchend" in document) document.write("<script src='styles/assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
    </script>
    <script src="styles/assets/js/bootstrap.min.js"></script>
    <script src="styles/assets/js/typeahead-bs2.min.js"></script>

    <!-- page specific plugin scripts -->

    <!-- ace scripts -->

    <script src="styles/assets/js/ace-elements.min.js"></script>
    <script src="styles/assets/js/ace.min.js"></script>

    <!-- inline scripts related to this page -->

    <script src="bower_components/jquery/jquery.js"></script>
    <script src="bower_components/angular/angular.js"></script>

    <!-- build:js scripts/plugins.js -->
    <script src="bower_components/bootstrap-sass/js/bootstrap-affix.js"></script>
    <script src="bower_components/bootstrap-sass/js/bootstrap-alert.js"></script>
    <script src="bower_components/bootstrap-sass/js/bootstrap-dropdown.js"></script>
    <script src="bower_components/bootstrap-sass/js/bootstrap-tooltip.js"></script>
    <script src="bower_components/bootstrap-sass/js/bootstrap-modal.js"></script>
    <script src="bower_components/bootstrap-sass/js/bootstrap-transition.js"></script>
    <script src="bower_components/bootstrap-sass/js/bootstrap-button.js"></script>
    <script src="bower_components/bootstrap-sass/js/bootstrap-popover.js"></script>
    <script src="bower_components/bootstrap-sass/js/bootstrap-typeahead.js"></script>
    <script src="bower_components/bootstrap-sass/js/bootstrap-carousel.js"></script>
    <script src="bower_components/bootstrap-sass/js/bootstrap-scrollspy.js"></script>
    <script src="bower_components/bootstrap-sass/js/bootstrap-collapse.js"></script>
    <script src="bower_components/bootstrap-sass/js/bootstrap-tab.js"></script>
    <!-- endbuild -->

    <!-- build:js scripts/modules.js -->
    <script src="bower_components/angular-resource/angular-resource.js"></script>
    <script src="bower_components/angular-cookies/angular-cookies.js"></script>
    <script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
    <!-- endbuild -->

    <!-- build:js({.tmp,app}) scripts/scripts.js -->
    <script src="scripts/app.js"></script>
    <script src="scripts/controllers/main.js"></script>
    <script src="scripts/controllers/invoiceUpload.js"></script>
    <!-- endbuild -->

I get like the following image. The left side menu is able to minimize. But the top right menus notification and profile drop-downs are not working. Those drop-downs are using the <a href="#">Welcome</a>

I thought it is because the href=# interrupting by the angularjs routing so I removed the # from that. And it is still not working. enter image description here

I removed 3 first 3 scripts imported inside tag. So I get like following image. The top menus are working. But left menu is not able to minimize and showing JQuery error in console that Uncaught ReferenceError: jQuery is not defined.

enter image description here

How can I solve this?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

Looking into the html you posted looks like you try to use conditional comments with non IE browsers. Apart from this, since you close the comment, shouldn't influence jQuery from being loaded by the browser.

Another possible reason is that you are using the wrong path to load jquery: I see styles/assets/js/jquery-2.0.3.min.js and bower_components/jquery/jquery.js maybe you should check which one is the correct one and move to the top.

share|improve this answer
    
I tried adding the bower_components/jquery/jquery.js first and removed the styles/assets/js/jquery-2.0.3.min.js. But it is still not working. –  Shiju K Babu Dec 19 '13 at 6:48
    
I tried removing all the JS inside bower_components/bootstrap-sass/js. And it is working. But shows some error in console. But the problem is in future may be I need to use these scripts. –  Shiju K Babu Dec 19 '13 at 6:53
    
Without removing the bootstrap-sass js components, just put <script src="bower_components/jquery/jquery.js"></script> at the top of the page, to see if it works –  john locke Dec 19 '13 at 6:58
    
I tried putting it as the first script import. The result is still the same –  Shiju K Babu Dec 19 '13 at 7:07

Angular does not currently support jQuery 2.x or above https://docs.angularjs.org/misc/faq

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.