Photoswipe with Angular


I am having a problem with Photoswipe and Angular. Basically what I’m doing is get the images from my server doing $ and then pushing that objects into my array of images, then I’m initializing Photoswipe.

I get an error: Code.PhotoSwipe.createInstance: No images to passed., so the initialize is getting fired before all my items are in the view.

I am getting all the images in my view but, any idea of how can I initialize it only after all my images are in the view?



How did you manage to initialize photoSwipe? I put a simple codepen together [here][1].
My problem is:

Uncaught TypeError: Cannot read property 'nodeName' of undefined 

I guess it could be the same isssue, the photoswipe being initilized beforoe the images are in the dom. And maybe the ionic.DomUtil.ready could be a solution?


I’m having the same problem trying to implement it. Any solutions yet? Much thanks!


Could you post your code into codepen ?


try instantiating your plugin inside $ionciPlatform.ready (inside your controller)

$ionicPlatform.ready(function() {
  // init photoswipe