Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Inline JavaScript in templates is no longer parsed after including jQuery #4524

Closed
aczekajski opened this issue Oct 18, 2013 · 3 comments
Closed

Comments

@aczekajski
Copy link

In AngularJS 1.0.8 when one included jQuery on the page, Angular was using jQuery instead of jqLite to parse the DOM and was able to execute the inline <script> containing JavaScript code in template.

Now, in 1.2.0-rc.2 and 1.2.0-rc.3, javascript is not being executed, even after including jQuery.

Simple examples illustrating the difference:
1.0.8 - http://plnkr.co/edit/ab2g4LLZxqXDAHl4Ia0x?p=preview
1.2.0-rc.3 - http://plnkr.co/edit/au2yBuxJXFJmSoZj7GII?p=preview
Inline scripts should output "Loaded!" and "Loaded2!" to the console. In rc.3 - it doesn't.

Btw, why not making Angular execute inline scripts on its own?

@petebacondarwin
Copy link
Contributor

According to #4555 this is because the animation library injects the script tag into DOM nodes that are not connected to the document and so jQuery doesn't run the script. It also notes that this can be worked around using a custom directive, which may be the idea solution in the long run.

@matsko
Copy link
Contributor

matsko commented Nov 22, 2013

@aczekajski I believe this was fixed in: #3756

@matsko
Copy link
Contributor

matsko commented Dec 30, 2013

Going to close this now. Please reopen if it is still not fixed.

@matsko matsko closed this as completed Dec 30, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants