I know this has been asked a thousand time, but I think I\'ve tried every solution I\'ve read and I can\'t seem to get it to work.
I have an API from which I\'m getting
I think this is happening because Angular is processing your directive before the results are bound to the list. It is probably a race condition. One way to solve this is to do
$scope.$broadcast("picsDownloaded" ...
event in your controller after you get the results. On the directive, instead of
scope.$watch(attr.photoswipe ....
do this
scope.$on("picsDownloaded" ....
and in that handler you apply the Jquery Plugin.