3

what is wrong with this code?

 $(document).on("click",".item-from-list",function(){

It works fine. But after I use navigator.replacePage(); It triggers the same time that I used replacePage(); Eg: I have a button that user select a day and it returns data. When user change the day, It uses navigator.replacePage(); and then is the problem. Now, if user click on list item, it triggers the event the same times the user has changed the day.

HTML:

    <div ng-controller="ListController">
      <ons-gesture-detector id="gd">
        <ons-carousel>
          <ons-carousel-item>
            <div class="item-label">
               <ons-scroller>
                  <ul class="list-i">
                      <li ng-repeat="data in itens" class="item-from-list">

I tried to use $(element).click(function); but it did not worked. Can someone help me?

Dyego Oviedo
  • 308
  • 4
  • 15
  • `$(document).on("click",".item-from-list",function(e){ e.stopPropagation();` try doing it with this – guradio Sep 22 '15 at 05:52
  • 1
    How about simply using ng-click on your
  • 's ? Also, calling event.stopPropagation() or event.preventDefault() may help.
  • – Andreas Sep 22 '15 at 06:22
  • I tried it all too but no sucess. I cannot use ngclick or onclick. Must be jquery. I'm sad. – Dyego Oviedo Sep 22 '15 at 06:52