Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49173

Lazy Load and Fallback Image in collection repeat

$
0
0

@anicacute09 wrote:

Hi guys, I have a list that uses collection repeat. I use lazy load and fallback directive for better UI performance... It works well when image path is correct but if it is null the lazy load stuck and fallback image is not shown.. Any one who manage to succeed in using these tactic.. or anything much better to use?

I use this for lazy load : https://github.com/paveisistemas/ionic-image-lazy-load

and use this directive for image fallback :

.directive('onErrorSrc', function() {
  return {
    link: function(scope, element, attrs) {
      element.bind('error', function() {
        if (attrs.src != attrs.onErrorSrc) {
          attrs.$set('src', attrs.onErrorSrc);
        }
      });
    }
  }
})

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49173

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>