1

I have a problem with my AngularJS app. I'm trying to use a JavaScript of a bootstrap template inside of a ng-view, but is not working. When I use this JavaScript in my index works great, but not inside of any view.

This is a part of my index.html:

    <!-- Breadcrumb -->

    <ng-view>
    </ng-view>
    <!-- Javascript Libraries -->
    <!-- jQuery -->
    <script src="js/jquery.min.js"></script> <!-- jQuery Library -->
    <script src="js/jquery-ui.min.js"></script> <!-- jQuery UI -->
    <script src="js/jquery.easing.1.3.js"></script> <!-- jQuery Easing - Requirred for Lightbox + Pie Charts-->

    <!-- Bootstrap -->
    <script src="js/bootstrap.min.js"></script>

    <!--  Form Related -->
    <script src="js/select.min.js"></script> <!-- Custom Select -->
    <script src="js/chosen.min.js"></script> <!-- Custom Multi Select -->
    <script src="js/datetimepicker.min.js"></script> <!-- Date & Time Picker -->
    <script src="js/colorpicker.min.js"></script> <!-- Color Picker -->
    <script src="js/icheck.js"></script> <!-- Custom Checkbox + Radio -->

When I use some of the features of any of the form related scripts inside of a ng-view don't work.

How can I use this scripts inside my ng-views?? I've tried to load the scripts inside the ng-views but still doesn't work.

amphetamachine
  • 27,620
  • 12
  • 60
  • 72
adpoy
  • 177
  • 2
  • 3
  • 12

1 Answers1

6

It's hard to see from your code snippet, but have you tried loading jquery before angularjs file ? Angular works with jqLite and if your not loaded jQuery before angularjs file angular tries to load it with jqLite.

But, it is preffered to convert your jquery plugins to a directive in order for them work properly in your angular project.

Dima Grossman
  • 2,800
  • 2
  • 21
  • 26
  • 2
    Thanks!! that solved my problem. Loading the scripts in the correct order works. Anyway, I can't convert the external scripts in directives, too much work. Those scripts are only for the look & feel and came with the bootstrap theme. – adpoy Oct 29 '14 at 11:31
  • Works but now my other ng-view fails to load content from my database – Photonic Jun 15 '15 at 07:24