I create a page that can add
, edit
, delete
users. I use php
to save the updated object
into json
file.
$scope.save = function() {
$http.post('php/saveusers.php', $scope.users).then(function() {
// log success
console.log($scope.users);
console.log("php called");
});
}
My problem is the view
update is not consistent. Every time I add
, edit
, delete
, the json
will be updated. But it html
sometimes update to new one, sometimes it doesn't. Even I refresh the page many times. The console.log($scope.users);
shows the latest result every time. But when I refresh the page, it goes back to the old one.
I believe it is the similar problem with this post. But I don't know how to empty or update local data
variable.
Update: This is my Plunker.