Ionic 2 rc3 image lazy load
I have many images cards on dashboard, that fluctuating images,
<ion-card class="custom" *ngFor="let post of posts" tappable (tap)="post.type == 3 ? detailPage($event,post) : ''"> <div class="dashbg" [ngStyle]="{'background-image': 'url(' + bs.setImage(post.image, 'trip', 'trip') + ')'}">
<ion-avatar item-right class="customb" *ngIf="post.going_picture != ''">
<div class="img" [ngStyle]="{'background-image': 'url(' + bs.setImage(post.going_picture, 'profile_pictures') + ')'}"></div>
</ion-avatar>
<h2 class="post-title">{{post.title}}</h2>
<p class="post-address" *ngIf="post.type == 3 ">
<ion-icon class="custom" name="md-pin"></ion-icon>
{{post.address}}
</p>
</ion-item>
</ion-card>
We already use ng2-lazyload-image, but it not working properly....
Can any one provide a example for this, in
@ykonstant thats rather more an Forum request then an issue.
I've added myself a image-loading-component (rather offline-caching).
In Angular2 you need to bypass the security:
import {DomSanitizer} from '@angular/platform-browser';
private sanitizer: DomSanitizer
obj.IMAGE_SRC = this.sanitizer.bypassSecurityTrustUrl(obj.IMAGE_URL);
And then you can set the src:
[src]="obj.IMAGE_SRC"
Hello! Thanks for using Ionic! While this is a support issue which should be taken to our forum or slack channel I will say that we have some very cool stuff coming up with ion-img that I think your gonna like! 😉
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.