Skip to content

Commit a079a42

Browse files
fix: post: added image extension in code snippets for ngOptimizedImage post. (#59)
* fix: post: added image extension in code snippets for ngOptimizedImage post.
1 parent b094e01 commit a079a42

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

_posts/2023-05-12-ng-optimized-image-directive-in-angular-15.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ import { CommonModule, NgOptimizedImage } from '@angular/common';
7979
import { Component } from '@angular/core';
8080
@Component({
8181
selector: 'app-optimised-image-catalog',
82-
template: `<img ngSrc="blog-food-img" width="500" height="300" alt="Food Blog Image"/> `,
82+
template: `<img ngSrc="blog-food-img.png" width="500" height="300" alt="Food Blog Image"/> `,
8383
})
8484
```
8585

@@ -91,7 +91,7 @@ import { CommonModule, NgOptimizedImage } from '@angular/common';
9191
@Component({
9292
selector: 'app-optimised-image-catalog', standalone: true,
9393
imports: [ CommonModule, NgOptimizedImage ],
94-
template: ` <img ngSrc="blog-food-img" width="500" height="300" alt="Food Blog Image" /> `, })
94+
template: ` <img ngSrc="blog-food-img.png" width="500" height="300" alt="Food Blog Image" /> `, })
9595
```
9696

9797
## Key features of `NgOptimizedImage`
@@ -191,7 +191,7 @@ import { NgOptimizedImage, IMAGE_LOADER, ImageLoaderConfig } from '@angular/comm
191191
return url; } }],
192192
193193
// in markup
194-
<img priority ngSrc="custom-img" width="50" height="50" alt="custom image"/>
194+
<img priority ngSrc="custom-img.png" width="50" height="50" alt="custom image"/>
195195
196196
// in DOM the img tag is changed to this
197197
<img _ngcontent-btb-c158="" ng-reflect-ng-src="business" ng-reflect-width="400" ng-reflect-height="400"
@@ -229,4 +229,4 @@ description="Results with NgOptimizedImage directive"
229229
%}
230230

231231
## In conclusion `NgOptimizedImage` means significant improvements...
232-
The PageSpeed results for the application using `NgOptimizedImage` show a significant reduction in time for the largest contentful paint. The intelligent lazy loading feature also improves the cumulative layout shift. In conclusion, the `NgOptimizedImage` directive drastically improves the performance of your application by enforcing the best practices for image optimisation.
232+
The PageSpeed results for the application using `NgOptimizedImage` show a significant reduction in time for the largest contentful paint. The intelligent lazy loading feature also improves the cumulative layout shift. In conclusion, the `NgOptimizedImage` directive drastically improves the performance of your application by enforcing the best practices for image optimisation.

0 commit comments

Comments
 (0)