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.

1
  • just a shot - did You try to load those files before ng-view? Commented Oct 20, 2014 at 5:58

1 Answer 1

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.

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

2 Comments

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.
Works but now my other ng-view fails to load content from my database

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.