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, 2022 in Web Development by gaurav
• 23,260 points
627 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, 2022 in Web Development by rajatha
• 7,680 points
2,870 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, 2022 in Web Development by gaurav
• 23,260 points
271 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,880 points
1,591 views
0 votes
1 answer

How to use JQuery with ReactJS

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

answered Jun 22, 2022 in Web Development by rajatha
• 7,680 points

edited Dec 15, 2023 by Soumya 13,933 views
0 votes
1 answer

Check if checkbox is checked with jQuery

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

answered Jun 23, 2022 in Web Development by rajatha
• 7,680 points
965 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, 2022 in Web Development by rajatha
• 7,680 points
272 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,880 points
5,653 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,880 points
4,133 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,880 points
9,934 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,880 points
1,431 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