jQuery click events not working with AngularJS

前端 未结 3 1056
醉酒成梦
醉酒成梦 2020-12-21 17:50

I am in the process of converting my multipaged php + jquery website into a single page angular app. However I have written a lot of code with jquery already so only intend

3条回答
  •  太阳男子
    2020-12-21 18:16

    alternatively: if you want to stick with jquery ..you may be able to make use of jquery's event delegation :

    for example:

    HTML

    
    

    JS:

    $('#parent').on('click', '.child', function() {
      console.log("click");
    });
    

    EDIT: added fiddle fwiw: https://jsfiddle.net/ge59sbtp/

提交回复
热议问题