-
Notifications
You must be signed in to change notification settings - Fork 142
Open
Description
Hello, I have a problem with the implementation of the webp images in my project, the lazy load works fine, but it loads me both images.
Thanks
Angular: 8.2.14
<div class="item" *ngFor="let item of specialties | slice:0:10 ; let indexOfElement = index; ">
<a (click)="buildDataLayerSpecialties(indexOfElement + 1, item.name)" [attr.href]="item.url">
<picture>
<source type="image/webp" [attr.defaultImage]="'assets/img/loading.gif'" [attr.lazyLoad]="item.baseImage+'webp/100x100/'+item.icon+'.webp'"/>
<source type="image/webp" [attr.defaultImage]="'assets/img/loading.gif'" [attr.lazyLoad]="item.baseImage+'100x100/'+item.icon+'.png'" />
<img [defaultImage]="'assets/img/loading.gif'" [lazyLoad]="item.baseImage+'100x100/'+item.icon+'.png'" alt="{{item.name}}">
</picture>
</a>
<a (click)="buildDataLayerSpecialties(indexOfElement + 1, item.name)" [attr.href]="item.url">{{item.name}}</a>
</div>
Metadata
Metadata
Assignees
Labels
No labels