使用laravel和angularjs的具有500条错误消息的httpRequest发布方法

时间:2019-06-11 14:46:04

标签: angularjs laravel

当我在angularjs中使用httprequest post方法提交数据时,出现了500条错误消息

模块:

var edum = angular.module('edum',['ngRoute','ngCookies','ngUpload','ui.autocomplete','angularUtils.directives.dirPagination','timer', 'checklist-model'])
.run(function($http,dataFactory,$rootScope,$q) {
----
});

控制器:

edum.controller('invoicesController', function(dataFactory,$scope,$sce,$rootScope,$route) {

$scope.collectInvoiceNow = function(id){
        showHideLoad();
        dataFactory.httpRequest('invoices/collect/'+id,'POST',{},$scope.form)
        .then(function(data) {
            response = apiResponse(data,'edit');
            if(data.status == "success"){
                $scope.collectInvoice = !$scope.collectInvoice;

                if($scope.views.invoice){
                    $scope.seeInvoice(id);
                }else {
                    location.reload();
                    //$scope.invoices = apiModifyTable($scope.invoices,response.id,response);
                }
            }
            showHideLoad(true);

        });
    }


});

我希望输出{消息:“付款成功创建” 状态:“成功” title:“添加付款”},但实际输出为500(内部服务器错误)

0 个答案:

没有答案