0

I have a view as below:

<headers>
    <h1>My Page</h1>
</headers>

<link rel="stylesheet" href="css/some.css"/>

<script ng-src="js/my-view-script.js"></script>

However, when the view is loaded the script isn't fetched. I've also tried <script src="js/my-view-script.js"></script> and had the same trouble.

So, how do I load a script file for a single view only?

CHeers

Dave

1 Answer 1

1

Try loading jQuery before AngularJS:

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>

I remember seeing it somewhere that jqLite (which is used by Angular) doesn't support that.

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

1 Comment

This solution works for angular v1.0.7 but does not work for v1.2.0rc1. Have not found a workaround yet.

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.