Created
September 11, 2019 06:35
-
-
Save StephenFluin/aa108d66553b70377fb425185db6c5d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Directive, ElementRef } from '@angular/core'; | |
@Directive({ | |
selector: 'img' | |
}) | |
export class LazyImagesDirective { | |
constructor(ref: ElementRef) { | |
ref.nativeElement.loading = 'lazy'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment