Nar*_*yas 13 html javascript refresher ionic2 angular
有没有办法只刷新一个页面,即ionic2中只有一个屏幕.
我试过了 :
window.location.reload();
Run Code Online (Sandbox Code Playgroud)
和
location.reload();
Run Code Online (Sandbox Code Playgroud)
但它重建应用程序..有没有办法只刷新该页面(特定屏幕).
还尝试过:
<ion-input *ngIf="no_internet === 1" (click)="refresh($event)"></ion-input>
Run Code Online (Sandbox Code Playgroud)
在TypeScript中:
refresh(refresher) {
console.log('Begin async operation', refresher);
setTimeout(() => {
console.log('Async operation has ended');
refresher.complete();
}, 2000);
}
Run Code Online (Sandbox Code Playgroud)
Ahm*_*deh 19
试试这段代码:
this.navCtrl.setRoot(this.navCtrl.getActive().component);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
31356 次 |
| 最近记录: |