思路: 对表单中内容进行修改,首先需要获取这个内容,再进行修改,再清空弹窗中的内容

//查询实体
$scope.findOne=function(id){
    $http.get('../brand/findOne.do?id='+id).success(
    function(response){
    $scope.entity= response;
    }
  );
}

第一步获取相应实体'

<button  type="button"  class="btn  bg-olive  btn-xs"  data-toggle="modal"
data-target="#editModal" ng-click="findOne(entity.id)" >修改</button>

第二步保存数据:

$scope.save=function(){
    var methodName='add';//方法名称
    if($scope.entity.id!=null){//如果有 ID
    methodName='update';//则执行修改方法
}
$http.post('../brand/'+ methodName +'.do',$scope.entity ).success(
    function(response){
    if(response.success){
//重新查询
    $scope.reloadList();//重新加载
    }else{
    alert(response.message);
  }
  }
  );
}

最新文章

  1. Rabin-Karp指纹字符串查找算法
  2. css文件 引用后不起作用
  3. JS 判断字串字节数,并截取长度
  4. 关于WEB 性能优化 (摘抄)
  5. jquery 判断网络资源,网络文件是否存在
  6. language model —— basic model 语言模型之基础模型
  7. Nginx下用webbench进行压力测试
  8. python paramiko ssh.exec_command()启动tomcat服务器应用进程失败问题解决方法- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these environment variable is needed to run this progr
  9. Qt之QSequentialAnimationGroup
  10. php 序列化(serialize)格式详解
  11. esui控件validatebox 通过正则判断输入 json传值
  12. DevExpress GridControl 列中显示图片
  13. MySQL Left Join,Right Join
  14. EasyUI - 后台管理系统 - 登陆模块
  15. Java反射获取字节码以及判断类型
  16. jdbcTemplate批量插入处理数据
  17. redis实战笔记
  18. 2018.12/6 js键盘事件 DOM:0级2级
  19. 【Sql Server】SQL SERVER 收缩日志
  20. python迭代器的说明

热门文章

  1. wamp集成环境下mysql数据库的分开部署和远程访问
  2. 1.《Spring学习笔记-MVC》系列文章,讲解返回json数据的文章共有3篇,分别为:
  3. 安装zabbix-agent报错 Error: failure: repodata/primary.xml.gz from zabbix: [Errno 256] No more mirrors to try.
  4. Linux 2.6 中的文件锁
  5. 前端学习笔记2017.6.12 CSS控制DIV
  6. 51NOD 1371填数字
  7. Linux网络服务管理命令
  8. CLRMonitor - 跟踪CLR内部执行过程工具
  9. Windows系统编程之进程同步试验
  10. GetTop(),GetTopLeft()等等