【发布时间】:2017-10-28 04:03:06
【问题描述】:
我正在使用带有 angularjs 的 mvc 创建一个 Web 应用程序,
我正在尝试在我的数据库中插入记录,但出现以下错误
错误:[$rootScope:inprog] http://errors.angularjs.org/1.6.4/$rootScope/inprog?p0=%24digest 在 angular.js:38 在 n (angular.js:18524) 在 m.$apply (angular.js:18259) 在 HTMLAnchorElement。 (angular.js:26999) 在 HTMLAnchorElement.dispatch (jquery-3.1.1.js:5201) 在 HTMLAnchorElement.elemData.handle (jquery-3.1.1.js:5009) 在 Object.trigger (jquery-3.1.1.js:8171) 在 HTMLAnchorElement。 (jquery-3.1.1.js:8239) 在 Function.each (jquery-3.1.1.js:368) 在 jQuery.fn.init.each (jquery-3.1.1.js:157)
这就是我的代码的样子
$scope.insertdata = function () {
$scope.students = {};
$scope.students.name = $scope.stdname;
$scope.students.fullname = $scope.stdfname;
$scope.students.address = $scope.stdaddress;
$scope.students.city = $scope.stdcity;
$scope.students.country = $scope.stdcountry;
$scope.students.contno = $scope.stdcontno;
$http({
method: "post",
url: "/dashboardquot/insert_employee",
datatype: "json",
contentType: "application/json",
data: $scope.students
}).then(function (response) {
angular.element('#closemodel').trigger('click');
})
}
正在插入数据,但仍然出现此错误 这段代码有什么问题?
【问题讨论】:
-
getdata() 在做什么?那个代码在哪里?
-
@rrd 更新了我的问题
标签: javascript jquery angularjs asp.net-mvc