Hi guys! We worked hard on some awesome things… Here’s one them –> #angular4 #Angular #javascript #angularjs

  • An image preload module for Angular using IntersectionObserver in favour of scroll listener’s.
  • You can add the directive to an element like this:

    The will not be preloaded, this is usually a spinner or some other light image.

  • The image will be shown when the element is in view.
  • If you need to preload a background image the directive can be placed on any html element like this:

    To show an image initially you can add a css background-image to the class.

  • This image will then be replaced when the element is in view.

ng-image-preload – An image preload module for Angular using IntersectionObserver in favour of scroll listener’s.

@jaspero_co: Hi guys! We worked hard on some awesome things… Here’s one them –> #angular4 #Angular #javascript #angularjs

GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.

An image preload module for Angular using IntersectionObserver in favour of scroll listener’s.

Then in your component initialize the service:

object:

A description for this options can be found here.

There are two ways to consume the library. Using the service or the directive.

in to a component.

element like this:

image will be shown when the element is in view.

directive can be placed on any html element like this:

To show an image initially you can add a css background-image to the class. This image will then be replaced when the element is in view.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

GitHub

You might also like More from author

Comments are closed, but trackbacks and pingbacks are open.