角度模板未更新

In my controller:

$scope.deleteUser = function(user){
        $.ajax({
            url: "/users/" + user.id.toString(),
            method: "DELETE",
            success: function(result){
                $scope.users = result["users"];
                alertify.success("done");
            },
            error: function () {
                alertify.error("error");
            }
        });
        return false;
    };

when I clicked in delete button user successfully removed in the server. In success function result["users"] object contains one less users. But in template

%tr{"ng-repeat" => "user in showedUsers | filter: fio_filter"}

row count not lessen. But when I again clicked on delete button row is removed! why this?

查看全部
weixin_33729196
weixin_33729196
2015/11/26 05:23
  • html
  • angularjs
  • ajax
  • javascript
  • 点赞
  • 收藏
  • 回答
    私信

1个回复