Closed darrenvng closed 8 years ago
Do you output the directive without a known src (in other words is that your usecase)? At the moment i'm testing without starting with empty source (which is invalid html i know <img alt="foo" />
). Other options mentioned have too many browsers issues, will try datauri but need browserfarm to test this.
I noticed extra calls being made to the server when new groups of images are lazy loaded as I scroll down my site. I believe it is being caused by images with empty image sources getting appended to the dom before they are eventually replaced by the lazy loaded url src.
I think in this file lazy-image.directive.js, on line 132, maybe you can set a src of 'about:blank' or 'javascript:void(0);' to prevent the extra request to the server. Or maybe to delay appending the element to the DOM until you have the lazy loaded url src ready.
Thanks, Darren