I am new in ionic.i created a sidemenu based app in that after login i am displaying a number of tasks if click on task it will redirect to task details page in that page i can update the tasks.so after updating a task i need to go back to previous task list page .i am using $ionicHistory.goBack(); for 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? Thanks in advance.
https://github.com/angular-ui/ui-router/issues/582
according to @hpawe01 "If you are using the current ionicframework (ionic: v1.0.0-beta.14, angularjs: v1.3.6, angular-ui-router: v0.2.13), the problem with the not-reloading-controller could be caused by the new caching-system of ionic: Note that because we are caching these views, we aren’t destroying scopes. Instead, scopes are being disconnected from the watch cycle. Because scopes are not being destroyed and recreated,controllers are not loading again on a subsequent viewing. There are several ways to disable caching. To disable it only for a single state, just add cache: false to the state definition. This fixed the problem for me (after hours of reading, trying, frustration). For all others not using ionicframework and still facing this problem: good luck!"
Hope this helps.
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][1]
2 - use ionRefresher
(my preferred) , read more here
HTH