0

I use "ng-repeat" in angular to render an array of images. for example:

<div ng-cloak class="thumbs" ng-hide="uploadDisplay" ng-repeat="photo in photos">
    <img ng-src="{{photo.url}}" ng-title="{{photo.description}}"/>
</div>

but how can i know all the images have finish rendered. Then i can call a third party plugin with:

$('.thumbs a').touchTouch(); 

Some kinds of plugins like touchTouch, need to initial the static Dom of images in page, but not allowed for dynamic dom. How can i use this kind of plugin here? is there function like onLoad in Angular that will be called after Dom finish render?

Frankjs
  • 565
  • 1
  • 4
  • 14
  • 1
    Use directive approach, it is easy: http://stackoverflow.com/questions/17547917/angularjs-image-onload-event – Ivan Chernykh Jan 08 '14 at 16:20
  • 2
    you need to add a directive and handle that in your module. See example: http://stackoverflow.com/questions/13471129/angularjs-ng-repeat-finish-event – Zeeshan Abbas Jan 08 '14 at 16:40
  • Don't `$('.thumbs a').touchTouch();`. Use an angular-based solution. See this question: http://stackoverflow.com/q/14994391/161278 – Omar Al-Ithawi Apr 03 '14 at 12:31

0 Answers0