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?