Skip to main content

How to lazy load images in Angular 6

Lazy loading is a technique to load the content only when the user asks for it. Therefore, the initial loading of the webpage is much faster as the complete page is not loaded. In case of lots of images on the webpage, it is always recommended to use lazy loading for the images. As an example, while showing a photo gallery, there is no point loading all the images in one go as the user may leave after only viewing the first few images and this would result in slower loading and waste of bandwidth. In such scenarios, lazy loading is an ideal choice. This post talks about how to lazy load images in Angular 6.
(more…)

Read More

Angular 6.1 introduces a new KeyValue Pipe

Angular 6.1 is out and it introduces a new KeyValue pipe to help you iterate through objects, maps, and arrays. Today, the ngFor directive doesn’t support iterations over objects or Maps. To fix this issue, Angular 6.1 introduces a new KeyValue pipe. The KeyValue pipe converts an Object or Map into an array of key-value pairs to use with ngFor directive. In this post, we’ll find out how to use this new KeyValue pipe with Angular 6.1 with examples. (more…)

Read More