Skip to content

Instantly share code, notes, and snippets.

@NetanelBasal
Created September 2, 2022 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NetanelBasal/7b65d6eca0c30cb25e979af0f474cbc1 to your computer and use it in GitHub Desktop.
Save NetanelBasal/7b65d6eca0c30cb25e979af0f474cbc1 to your computer and use it in GitHub Desktop.
@Directive({
standalone: true,
selector: 'img[rawSrc]',
})
export class NgOptimizedImage implements OnInit, OnChanges, OnDestroy {
private imageLoader = inject(IMAGE_LOADER);
private renderer = inject(Renderer2);
private imgElement: HTMLImageElement = inject(ElementRef).nativeElement;
private injector = inject(Injector);
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment