In my angular project, when changing the path with $location.path('/foobar')
the destination view is displayed but the data aren't reloaded (typically after saving an item and going back to the list, the list is not updated).
I tried to add $route.reload()
or $scope.apply()
, but nothing change.
I don't know what's wrong or missing to make this work.
UPDATE
$location.url()
doesnt' work either- I'm using angular 1.2.26
UPDATE 2 - ANSWER
Ok, after a lot of comments and answers, I think it's time to end this.
I didn't think it would have been a so complicated question.
So, my conclusion, giving all you said is :
- Giving simple example of @yvesmancera, the default behavior of the controller is to reload itself
- In a complex controller with a resource factory and some REST calls, any save or update action should also manually update the list reference, or trigger a full reload of the list
All of you gave me some good advices, so thank you.