angularjs 保存数据 和 check
来源:互联网 发布:tracert linux 编辑:程序博客网 时间:2024/05/21 08:35
// 保存信息(新增/修改)
$scope.save = function() {
// 防止二次提交
$scope.btnSaveEnable = false;
$scope.error = "";
// check
if (!inputCheck()) {
// 防止二次提交
$scope.btnSaveEnable = true;
return;
}
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, status, headers, config) {
$scope.error = "保存时,发生系统异常。";
$scope.btnSaveEnable = true;
});
$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, status, headers, config) {
$scope.error = "保存时,发生系统异常。";
$scope.btnSaveEnable = true;
});
};
function inputCheck() {
if (isEmpty($scope.searchInfo.playbackName)) {
$scope.error = "请输入回播室名称";
return false;
}
return true;
};
0 0
- angularjs 保存数据 和 check
- angularjs service全局保存数据的误区
- AngularJS-模板和数据绑定
- AngularJS数据绑定和数据过滤
- 图片保存和数据读入保存方法
- Jquery和angularjs获取check框选中的值小技巧
- Jquery和angularjs获取check框选中的值小技巧
- R-数据保存和输出
- 状态数据保存和恢复
- 运动数据保存和发送
- Spark加载和保存数据
- Cocos2d-x_保存数据和读取数据
- Libgdx之数据保存 和 数据加密
- 全角check 和 半角check
- 【全角check】 和 【半角check】
- Devexpress控件之check box list的初始赋值和勾选值保存
- check表单提交数据
- Android-SharedPreference自动保存和手动保存数据-Oak先生
- C/C++基本数据类型
- js可编辑表格
- 功能强大的html网站后台管理系统模板代码下载
- Android 禁止系统休眠,使屏幕不变暗,保持游戏中屏幕高亮
- HTTP基础:URL格式、 HTTP请求、响应、消息
- angularjs 保存数据 和 check
- 17.1节练习
- EJB知识点大全
- 数据结构 猫狗队列
- UnicodeDecodeError: ‘XXX’ codec can’t decode bytes in position 2-5: illegal multibyte sequence
- 职场职位缩写 PM,TM,PL,TL,SE,PG,CEO,CFO
- static全局变量与普通的全局变量有什么区别?static局部变量和普通局部变量有什么区别?static函数与普通函数有什么区别?
- iPhone - 读取工程包中的二进制文件
- JS刷新页面的几种方法