Skip to content

Commit

Permalink
fixup! feat(common): add <link> preload tag on server for priority img
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewKushnir committed Oct 10, 2022
1 parent 5047854 commit 2969b99
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -401,14 +401,17 @@ export class NgOptimizedImage implements OnInit, OnChanges, OnDestroy {

if (this.ngSrcset) {
rewrittenSrcset = this.getRewrittenSrcset();
} else if (!this._disableOptimizedSrcset && !this.srcset) {
rewrittenSrcset = this.getAutomaticSrcset();
}

if (rewrittenSrcset) {
this.setHostAttribute('srcset', rewrittenSrcset);
}

if (this.isServer && this.priority) {
this.preloadLinkChecker.createPreloadLinkTag(
this.renderer, rewrittenSrc, rewrittenSrcset, this.sizes);
} else if (!this._disableOptimizedSrcset && !this.srcset) {
this.setHostAttribute('srcset', this.getAutomaticSrcset());
}
}

Expand Down

0 comments on commit 2969b99

Please sign in to comment.