Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reload the ionic view?

I have created a sidemenu based app, in that after login I am displaying a number of tasks. If I click on the task it will redirect to the task details page, in that page I can update the tasks.

So after updating a task I need to go back to the previous task list page. I am using $ionicHistory.goBack(); to go back.

My problem is after come back, I need to refresh the task list i.e. updated task should not be there in the task list. How can I refresh/reload the task list?

like image 460
Test user Avatar asked Apr 20 '15 06:04

Test user


People also ask

How do you refresh an ionic page?

Ionic provides the same by using <ion-refresher> component to add a pull-down feature. The <ion-refresher> component provides pull-to-refresh functionality on a content component. An Ionic allows a user to use this pattern on a list of data using touch to retrieve more data.

How do you restart the ionic app?

Press and hold all three buttons on the Ionic until you see the Fitbit logo.

What is live reload ionic?

One option that can boost productivity when building Ionic apps is Live Reload (or live-reload). When active, Live Reload will reload the browser or Web View when changes in the app are detected. This is particularly useful for developing using hardware devices.

How do I run an ionic app on localhost?

By default, ionic serve boots up a development server on localhost . To serve to your LAN, specify the --external option, which will use all network interfaces and print the external address(es) on which your app is being served. Try the --lab option to see multiple platforms at once. ionic serve uses the Angular CLI.


1 Answers

If you bind your task to a tasks array, which will be used in the task list page, it should be automatically updated.

But the question is about not displaying, newly added tasks (still my previous suggestion should work) if not, performance reasons ionic views are cached, So when you come back to the previous view it doesn't go through the normal loading cycle. But you 2 options

1 - disable the caching by using <ion-view cache-view="false" view-title="My Title!"> in your ion-view, but this is not a very elegant solution. read more

2 - use ionRefresher (my preferred). read more here

like image 196
sameera207 Avatar answered Sep 24 '22 16:09

sameera207