add refresh function

This commit is contained in:
Siwat Sirichai 2021-12-08 17:10:36 +07:00
parent 6320923922
commit 7247477d51
3 changed files with 15 additions and 3 deletions

View File

@ -17,7 +17,7 @@ export class DataProviderService {
// allData(){
// return this.http.get('https://bc50-104-199-132-26.ngrok.io/alldata');
// }
public url = 'http://796c-35-186-184-86.ngrok.io/'
public url = 'http://6447-35-186-184-86.ngrok.io'
insert(dbname: String,colname: String,web: String,cat: String){
//return this.http.get<providerData>("http://localhost:/insert?dbname="+dbname+"&collectionname="+colname+"&web="+web+"&cat="+cat);
return this.http.get<providerData>(this.url+"/insert?dbname=data&collectionname=testdata&web=com.burbn.instagram&cat=photos");

View File

@ -1,11 +1,15 @@
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
Charts.js in Ionic 5
Charts
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content></ion-refresher-content>
</ion-refresher>
<div class="ion-padding">
<ion-card>
<ion-text>

View File

@ -221,5 +221,13 @@ export class HomePage {
}
});
}
doRefresh(event){
this.myDataProvider.updateData();
this.barChartMethod();
this.doughnutChartMethod();
setTimeout(() => {
console.log('Async operation has ended');
event.target.complete();
}, 2000);
}
}