[Solved] V2 Cannot Refresh Current Page


#1

I was using the following code in V1 to refresh the current page can someone help me with the new code for V2 as hours of trial and error have failed:

var current_view = app.getCurrentView();
current_view.router.refreshPage();

Thanks in advance!


#2
view.router.navigate(view.router.currentRoute.url, {
        ignoreCache  : true,
        reloadCurrent : true
    });

#3

Worked a charm! Thanks so much for the fast response


#4

For below case am getting view is not defined error.

$$(document).on('online', function () {
	var toastBottom = app.toast.create({
			text: 'Device is online.',
			closeTimeout: 3000
		})
		toastBottom.open();

	view.router.navigate(view.router.currentRoute.url, {
		ignoreCache: true,
		reloadCurrent: true
	});

})