I am having a problem with Photoswipe and Angular. Basically what I'm doing is get the images from my server using $http.post
and then pushing those objects into my array of images, then I'm initializing Photoswipe.
In my success I have something like this:
$scope.gallery.push(images from server);
myPhotoSwipe.initialize()
But I get this error: Code.PhotoSwipe.createInstance: No images to passed
, so the initialize is getting fired before all my items are in the view.
I can see all the images in my view but of course they are not attach to Photoswipe, any idea of how can I initialize it only after all my images are in the view?
PS: I have already tried this: How can I get directive to fire after view loaded? but it didn't work for me
Thanks!