简体   繁体   中英

Call a javascript function when ng-repeat finishes

This is my first attempt at Angular so please bear with me.

I have a jQuery slider that usually is initialized at document ready. However this doesn't work when the images are being populated by angular since it will not have finished rendering the DOM.

Is there a way to detect when ng-repeat finished rendering the DOM so that I can call my function?

Thanks in advance

Check out this answer Stack Overflow . Setting a timeout is never a good way to wait til something finishes. I would suggest a custom directive checking to see if you are scope.$last, then you can broadcast an event to the controller.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM