Angularjs Template. Inner Js Not Execute
Solution 1:
In the current version (1.0.4 and 1.1.2) AngularJS will not execute any JavaScript code contained in a partial specified via templateUrl
(or template
).
At the moment your best option is to pre-load most of the code up-front. People were experimenting with requireJS and there are many questions about it on SO and the mailing list. But the truth is that - while loading on-demand can be done for controllers and partials - in general on-demand load is not well supported (see How is modularity mitigated in AngularJS? for more on this). In practice it might not be a problem since code written with AngularJS tends to be really, really concise so pre-loading things up-front doesn't have adverse performance implications (on the contrary, since all the code is in a browser there are no delays linked to on-demand load).
Load on-demand is a feature that is being worked on as part of AngularJS 2.0.
Post a Comment for "Angularjs Template. Inner Js Not Execute"