Last active
May 28, 2018 08:55
-
-
Save realtomaszkula/14ebb35f431bfc966531b48188890c57 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[appProgressiveImage]', | |
providers: [...] | |
}) | |
export class ProgressiveImageDirective implements OnInit, Dimensions { | |
// ... | |
@HostBinding('style.display') display = Display.flex; | |
constructor(private imageState: ImageStateService) {} | |
ngOnInit() { | |
this.imageState.isLoaded$.subscribe(loaded => { | |
this.display = loaded ? Display.flex : Display.none; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment