Hi, i have tried to integrate photoswipe and angularjs but at the moment i have found some problems.
When i click in an image Photoswipe rewrite the url adding an anchor to current url
Current URL:
http://localhost:8000/#/view2
After Click:
http://localhost:8000/#/view2#PhotoSwipe1375822623328
When i click in an image Photoswipe rewrite the url adding an anchor to current url.
AngularJs uses # to create routes and when a route is not found it try to redirect to another url.
This problem not occurs in chrome, i don't know why.
I would like to know if is possible remove this behaviour of PhotoSwipe or if someone have a trick.
Regards!
The solution to this problem was use the option:
backButtonHideEnabled: false
THANK YOU @dbuarque. Thank you, Thank you!!!!!!
God bless you my friend, and bring you lots of kids and luck. You just saved me hours of debugging. Thank you so much for sharing this solution!!!
Hahahahahahah, thanks @dbuarque !!! I had the same problem, and this solved it like a charm!!!
hi, i have the same angular problem. where to use "backButtonHideEnabled: false" to fix it?
when you call the function
$('a'). photoSwipe({backButtonHideEnabled: false});
:)
Excellent. It also saved me hours of debugging, thanks!
Cool!
Thank you soooo much!!!
Do you think it is worth to have a angular version repo?
For those who are stumbling across this now or in the future, it looks like the "backButtonHideEnabled" has been replaced with "history":
{history: false}
Hi any sample code for this? been looking to implement this the right way in Angular
any angular directive for photoswipe?
Thanks guys, saved me hours too :+1:
@dbuarque can you share your implementation within Angular ? :smile:
var options = {history: false}
:+1: :beers:
Passing this option in while instantiating a new PhotoSwipe is important if you are adding a photoswipe instance inside of an angular route partial. If photoswipe is initialized by the controller of a route (or if you attach a controller to the 'pswp' div, the URL re-write will cause the controller to be created over and over again, which could result in something like this: Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Thanks @thesafetylemur!
Most helpful comment
The solution to this problem was use the option:
backButtonHideEnabled: false