Angular jQuery on doesn t work with ng-repeat

0 votes

jQuery .on() is not working with ng-repeat, when I fetch data by $http().

It's working fine:

<div ng-repeat="item in ['arrow-new', 'arrow-work', 'arrow-close']" class="arrow {{item}}">
</div>

Events:

$(".arrow").on('mouseenter mouseleave', function (event) {
  if (event.type == 'mouseenter') {
    //Ok
  } else {
  }
});

But when I load my array for iteration with $http() like this:

<div ng-repeat="item in statused" class="arrow {{item}}">
</div>

$http({ method: 'GET', url: '/app/data/statuses.json' }).success(function (data) {
   $scope.statused = data;
});

my arrow is rendering fine, but events is not binding. I haven't error in debug console. How can I solve this problem?

Aug 22 in Web Development by gaurav
• 18,960 points
34 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Web Development

0 votes
1 answer

jquery .on() method with load event

load() . The load() method attaches an event ...READ MORE

answered Aug 4 in Web Development by rajatha
• 7,440 points
104 views
0 votes
0 answers

Grab computed background-size on Internet Explorer with jQuery

I have this style: #bkg-evs-1 { ...READ MORE

Aug 19 in Web Development by gaurav
• 18,960 points
21 views
0 votes
1 answer

How to track with Google Analytics on a redirection page with PHP?

Hello @kartik, Since the page that is sending ...READ MORE

answered Jul 7, 2020 in Web Development by Niroj
• 82,780 points
1,004 views
0 votes
1 answer

How to use JQuery with ReactJS

Yes, we can use jQuery in ReactJs. ...READ MORE

answered Jun 22 in Web Development by rajatha
• 7,440 points
102 views
0 votes
1 answer

Check if checkbox is checked with jQuery

To check whether a Checkbox has been ...READ MORE

answered Jun 23 in Web Development by rajatha
• 7,440 points
85 views
0 votes
1 answer

How to hide a div with jQuery?

We hide the divs by adding a CSS ...READ MORE

answered Jun 27 in Web Development by rajatha
• 7,440 points
37 views
0 votes
1 answer

Error: cannot call methods on button prior to initialization; attempted to call method 'loading'

Hii @kartik, It's caused by jquery-ui and bootstrap-button ...READ MORE

answered May 12, 2020 in JQuery by Niroj
• 82,780 points
3,249 views
0 votes
1 answer

How to set jquery input select all on focus?

Hello @kartik, Try using click instead of focus. It seems to ...READ MORE

answered Nov 24, 2020 in JQuery by Niroj
• 82,780 points
1,938 views
0 votes
1 answer

How to make $.post() use contentType=application/json in jquery?

Hii, Try this: $.ajax({ url:url, type:"POST", ...READ MORE

answered Nov 24, 2020 in JQuery by Niroj
• 82,780 points
3,476 views
0 votes
1 answer

How to add a “readonly” attribute to an <input>?

Hello, For jQuery <1.9 $('#inputId').attr('readonly', true); ...READ MORE

answered Nov 24, 2020 in JQuery by Niroj
• 82,780 points
415 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP