Riron / ionic-img-viewer

Ionic 2+ component providing a Twitter inspired experience to visualize pictures.
MIT License
283 stars 118 forks source link

Add optional image src. #31

Closed cupidi closed 7 years ago

cupidi commented 7 years ago

Hi!

I did this change because sometimes you need to display an image from a different source. For example you have a low res thumbnail in your element but on click you want to display the original.

Regards, Mario

ascorbic commented 7 years ago

I came here to open a pull request that's almost identical! The difference with mine is that I used a different attribute (zoom) rather than src. How do you avoid the src input conflicting with the native src?

ascorbic commented 7 years ago

The "right" way to do it is probably with srcset, but that opens a whole load of complexity.

Riron commented 7 years ago

Great idea !

@ascorbic it's done thanks to @Input('imageViewer') src. The value of imageViewer is binded to src . eg: <img imageViewer="zoomedImage.jpg" src="smallImage.jpg" />