boutique replica bags up ideas

the best replique rolex and prices here.

julia highlight 99j hair color 10a quality straight human hair lace front wigs 8 - 24 inches pre plucked hairline 13x4 inches lace front brazilian wig onlinefor sale

Lazy Load Images in Angular

Updated on     Kisan Patel

<img loading=lazy> is supported by most popular Chromium-powered browsers (Chrome, Edge, Opera) and Firefox.

<img src="logo.png" alt="logo" loading="lazy">

Let’s create a directive to add loading="lazy" attribute to our img element if browser support as below:

ng g d lazy-img

lazy-Img.directive.ts

import { Directive, ElementRef } from '@angular/core';

@Directive({ selector: 'img' })
export class LazyImgDirective {
   constructor({ nativeElement }: ElementRef<HTMLImageElement>) {
     const supports = 'loading' in HTMLImageElement.prototype;

     if (supports) {
       nativeElement.setAttribute('loading', 'lazy');
     }
   }
}

Also, Refer another solution: https://stackblitz.com/edit/angular-lazy-images


Angular

Leave a Reply