In my angular project, when changing the path using $location.path('/foobar') , the destination view is displayed, but the data does not reload (as a rule, the list is not updated after saving the item and returning to the list).
I tried adding $route.reload() or $scope.apply() , but nothing changed.
I do not know what is wrong or not to make this work.
UPDATE
$location.url() doesn't work either- I am using angular 1.2.26
UPDATE 2 - ANSWER
Well, after a lot of comments and answers, I think it's time to finish this.
I did not think that would be such a difficult question.
So, my conclusion, giving everything you said:
- By providing a simple @yvesmancera example, the default behavior of the controller is to reboot
- In a complex controller with a factory resource and some REST calls, any save or update action should also manually update the list link or start a full list reload
You all gave me good advice, so thanks.
javascript angularjs
Sylver
source share