javascript - 如何在执行函数后重新加载 http.get 请求

标签 javascript php angularjs http

我正在尝试从列表中删除帖子。删除函数是通过串行传递到如下所示的删除函数来执行的。

$scope.go = function(ref) {
  $http.get("api/phone_recev.php?id="+ref)
  .success(function (data) { });
}

执行该功能后,我需要重新加载用于列出列表的http.get请求。

$http.get("api/phone_accept.php")
.then(function (response) { });

一旦函数执行。整个列表将重新加载新的更新列表。有什么办法可以做到这一点吗?

最佳答案

试试这个

$scope.go = function(ref) {
  $http.get("api/phone_recev.php?id="+ref)
  .success(function (data) {
  //on success of first function it will call

    $http.get("api/phone_accept.php")
     .then(function (response) { 

    });
  });
}

关于javascript - 如何在执行函数后重新加载 http.get 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42061159/

相关文章:

javascript - 如何基于 bool 属性有条件地在 ReactJS 中应用嵌套的 SCSS 类?

php - 有没有不需要javascript的博客网站评论系统?

javascript - 在下拉列表中加载国家/地区

php - 如何使用 jQuery 将数据从 PHP 加载到 Handsontable?

PHP 换行符 (\n) 不工作

android - 如何在 ionic 中打开键盘时以编程方式使屏幕滚动到顶部

javascript - Angular.js aHrefSanitizationWhitelist 不工作?

javascript - 如果发生任何操作则重定向页面

php - 是否有像 phpMyAdmin 这样的工具可以配置为只访问一个数据库?

angularjs - 使用 angularjs 时如何仅在 Meanjs 中保护经过身份验证的用户的功能