paveisistemas / ionic-image-lazy-load

Directive to Ionic Framework that only loads an image when it is seen by the user.
http://codepen.io/pavei/pen/oFpCy
MIT License
366 stars 117 forks source link

Added ability to initiate lazy load for any type of bindable event #28

Open ghost opened 9 years ago

ghost commented 9 years ago

I added a directive so that lazy loading can be initiated by any type of bindable event. I created this functionality because I had a case where a user could filter the list of images being displayed. The filtered images (which were outside of the view) were not being loaded.

I abstracted the lazyScroll directive so that I could apply it to my filter textbox with a keyup binding. Which looks like this:

<quick-filter qf-model="photoList.searchText" lazy-load-on="keyup"></quick-filter>

This new directive allows you to apply any bindable event, thus expanding the use cases. I figured I would go ahead and create a pull request in case it would be helpful for others. Thanks!