Last active
June 3, 2018 19:44
-
-
Save realtomaszkula/6ac80911484acaaa7de1f3e8f842a9f7 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
@Directive({ | |
selector: 'img[appLazyLoad]' | |
}) | |
export class LazyLoadDirective implements AfterViewInit { | |
@HostBinding('attr.src') srcAttr = null; | |
@Input() src: string; | |
private loadImage() { | |
this.srcAttr = this.src; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment