Closed gatapia closed 7 years ago
You mean you would like to have a programmatic way to launch the viewer ? Like in an onClick
handler instead of with the directive ?
Sounds like a good idea !
I'll try to give it a look, but feel free to make a PR if you wish 👍
I've just created a pull request for this because I needed to instantiate the ImageViewer through a dynamic component instead of a directive (using ng-dynamic). @Riron thank you for this amazing module.
Since #58 has been merged, I think this issue can be closed as soon as 2.4.0 is published.
So, using master is possible to use click handlers and instantiate the ImageViewer? If yes, could you please provide some example?
I'm facing the same issue, this would be a great help.
Yeah it's technically possible with ng-dynamic
but not intuitive and adds more dependencies. If you wait just a few more days, an "official way" of doing it will land in the next release 😉
ok @Riron I'll wait. Thank you a lot for this module
Closing this issue as it landed in ionic-img-viewer@2.4.0
.
I am loading html content from the server and displaying it in an ionic app. It would be great to be able to use this plugin to add imageViewer support for these dynamically loaded img tags. I tried to manually add click handlers to these images and using ImageViewer.create (copying code from your directive) but it appears that your module is not exporting the ImageViewer class.
Not totally familiar with the internals of modules in ng2 so not sure whether adding this to the exports would do the trick. Anyways, would be nice to have, in the meantime I'm hacking something together.
Update: can confirm that if I add ImageViewer to the generated exports from your module then dynamic images are supported.