search

Home  >  Q&A  >  body text

angular.js - angular directive link event binding problem

1. Why does setting up to prevent bubbling result in an error


Why do you get an error when setting the third parameter (false, true) when adding event binding? It’s okay if you don’t set it

2. Why is the binding tap event triggered twice?


If you change it to click it will be normal

仅有的幸福仅有的幸福2810 days ago656

reply all(1)I'll reply

  • PHPz

    PHPz2017-05-15 16:59:38

    1 .on( events [, selector ] [, data ], handler )
    on ​​method api, the last parameter represents the event callback
    The method to prevent bubbling is
    2 .on("tap",function(e){ e.stopPropagation();})
    3 If you are not using IScroll, it is recommended to use click. If you are using ISroll, configure click:true

    reply
    0
  • Cancelreply