Angular 2: Lazy-loading images using bLazy.js
I recently had the need to integrate bLazy in an Angular 2 project. This is a pure Javascript library so the integration was straightforward but it does have a few drawbacks to be aware of, especially due to the way Angular renders elements.
The trick was wrapping bLazy initialization inside a setTimeout() which seems to be the only way for bLazy to properly set itself up.
Here’s the code:
Read more...