加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs 保存数据 和 check

发布时间:2020-12-17 10:04:51 所属栏目:安全 来源:网络整理
导读:// 保存信息(新增/修改) $scope.save = function() { // 防止二次提交 $scope.btnSaveEnable = false; $scope.error = ""; // check if (!inputCheck()) { // 防止二次提交 $scope.btnSaveEnable = true; return; } $scope.searchInfo.type=$("#type").val(
// 保存信息(新增/修改)
$scope.save = function() {
// 防止二次提交

$scope.btnSaveEnable = false;
$scope.error = "";

// check
if (!inputCheck()) {
// 防止二次提交
$scope.btnSaveEnable = true;
return;
}

$scope.searchInfo.type=$("#type").val();

$http({

method : "post",
url : "find/save",
data :$scope.searchInfo
}).success(function(rs,status,headers,config) {
if (rs.status == 0) {
$scope.success = "操作成功。";
var back = 1;
location.href = base + "/backplayroom-" + back;
} else {
$scope.error = rs.message;
$scope.btnSaveEnable = true;
}
}).error(function(rs,config) {
$scope.error = "保存时,发生系统异常。";
$scope.btnSaveEnable = true;
});

};

function inputCheck() {
if (isEmpty($scope.searchInfo.playbackName)) {
$scope.error = "请输入回播室名称";
return false;
}

return true;

};

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读