Skip to content

Instantly share code, notes, and snippets.

@realtomaszkula
Last active May 28, 2018 08:17
Show Gist options
  • Save realtomaszkula/821084cb28d5304febe152ba3bbba229 to your computer and use it in GitHub Desktop.
Save realtomaszkula/821084cb28d5304febe152ba3bbba229 to your computer and use it in GitHub Desktop.
@Directive({
selector: 'img[appProgressiveImage]',
})
export class ProgressiveImageDirective {
@HostBinding('attr.src')
@Input() src: string;
@HostBinding('style.width.px')
width: number;
@HostBinding('style.height.px')
height: number;
}
@Directive({
selector: '[appProgressiveImageFallback]',
})
export class ProgressiveImageFallbackDirective {
@HostBinding('style.width.px')
width: number;
@HostBinding('style.height.px')
height: number;
}
@Directive({
selector: '[appProgressiveImagePlaceholder]',
})
export class ProgressiveImagePlaceholderDirective {
@HostBinding('style.width.px')
width: number;
@HostBinding('style.height.px')
height: number;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment