Jquery Or Jqlite Not Working With Elements Inside
index.html: general.html
ppp
pppppp
javascript var app =Solution 1:
document ready in jquery can happen before angular has finished loading (e.g. before it injects the ng-view). This is even more true if you use an on demand script system like require.js.
As such you should
A: Use Angular's version of document ready,
angular.element(document).ready(function () {
$("#aaa").on("click",function(){
alert('clicked');
});
$("#bbb").on("click",function(){
alert('clicked');
});
});
B: (The angular way)
Build an angular directive for any custom elements you want, or a form, or a widget, or w/e you are building (compartmentilize it) so that you can handle the directives link or compile function, where you can then subscribe to events on the element (like an anchor) and have access to it's event objects.
Post a Comment for "Jquery Or Jqlite Not Working With Elements Inside "