ng-if in ng-repeat

12 views
Skip to first unread message

Szabo Zsolt

unread,
Nov 13, 2017, 10:11:01 AM11/13/17
to Angular and AngularJS discussion
Hi!

I have an imageonload directive which check if image is loaded or not.
And the html:
<li ng-repeat="lis in list | orderBy:propertyName track by $index">
  <img ng-src="{{lis.PIX}}" imageonload="doThis($index)">
  <span ng-if="loadicon">
    -
    -
    -

$scope.doThis = function ($index){
  console.log($index);
  $scope.loadicon = false;
};

I want to remove the loadicon, if image is loaded. My problem is that, when the first image is loaded, every loadicon remove in ng-repeat, not only loaded.
How can i access only indexed item? /($scope.loadicon[$index] = false;)/

Or this is a bad thing...

Thanks!
Reply all
Reply to author
Forward
0 new messages