Reputation: 161
I have this HTML syntaks for loop my URL, the URL for get an image from my directory by internet, but when image changed in my server, the application still showed last image before I update, I was only change image not name.
<ion-card style="margin: auto">
<ion-card-header class ="head" style="background-color: gray !important">
<font color="White">{{dt.desc}}</font>
</ion-card-header>
<img src= {{dt.name}} >
</ion-card>
Whats wrong with this, and how to make image change whenever i change image in server? In my case the image can replace to new image I've update when I uninstall that apps
Upvotes: 0
Views: 2760
Reputation: 1503
You can use this trick to add a random number after the url so the ionic app will refresh the link thinking its a new link.
this.dt.name = 'www.yourimage.com/image.jpeg?random+\=' + Math.random());
Upvotes: 4
Reputation: 302
Can you use https://ionicframework.com/docs/api/components/refresher/Refresher/. But you have to retake your data in doRefresh(refresher).
Upvotes: 0