Test user Test user - 1 year ago 203
AngularJS Question

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

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?

Answer Source

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