angularJs 表格添加删除修改查询
来源:互联网 发布:融资租赁渠道 知乎 编辑:程序博客网 时间:2024/05/16 05:33
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <script src="agl/angular.min.js"></script> <script> var app=angular.module("mpp",[]); app.controller("ctrl",function ($scope) { $scope.arr=[]; $scope.add=function () { $scope.arr.push({name:$scope.name,password:$scope.password,age:$scope.age,sex:$scope.sex}) } $scope.submit=function () { for (var i=0;i<$scope.arr.length;i++) { if($scope.arr[i].name==$scope.name2) { if($scope.arr[i].password==$scope.pass) { if($scope.pass2==$scope.pass){ $scope.arr[i].password=$scope.pass2; }else{ alert("两次输入不一致"); } }else { alert("密码错误"); } }else { alert("用户名错误"); } } } $scope.flag=false; $scope.show=function () { $scope.flag=true; } }) </script> <link rel="stylesheet" href="css/style.css"></head><body ng-app="mpp" ng-controller="ctrl"><div class="inner"> <input type="text" placeholder="用户名查询" ng-model="user"> <input type="text" placeholder="年龄范围查询" ng-model="ages"> <select ng-model="sexs"> <option value="男">男</option> <option value="女">女</option></select> <button>全部删除</button> <TABLE> <tr> <th>Id</th> <th>用户名</th> <th>密码</th> <th>年龄</th> <th>性别</th> <th>操作</th> </tr> <tr ng-repeat="item in arr|filter:{name:user}|filter:{age:ages}|filter:{sex:sexs}"> <td>{{$index+1}}</td> <td>{{item.name}}</td> <td>{{item.password}}</td> <td>{{item.age}}</td> <td>{{item.sex}}</td> <td><button ng-click="show()">修改密码</button></td> </tr> </TABLE> <button ng-click="add()">添加用户</button> <div class="conner"> <div class="add"> 用户名:<input type="text" ng-model="name"><br> 密 码:<input type="password" ng-model="password"><br> 年 龄:<input type="text" ng-model="age"><br> 性 别:<select ng-model="sex"> <option value="男">男</option> <option value="女">女</option></select><br> </div> <div class="update" ng-show="flag"> 用户名:<input type="text" ng-model="name2"><br> 旧密码:<input type="text" ng-model="pass"><br> 新密码:<input type="password" ng-model="pass2"><br> 确认密码:<input type="password" ng-model="pass3"><br> </div> </div> <button ng-click="submit()">提交</button></div></body></html>
css
*{
margin: 0; padding: 0;}.inner{ margin: 20px auto; text-align: center;}table{ margin: 10px auto; text-align: center;}tr{ border-collapse: collapse;}tr th,td{ border:1px solid #000000; width: 60px;}.conner{ width: 600px; height: 300px; background: #ffe7e0; margin: 0 auto;}.add{ margin: 10px auto; padding-top: 20px; width: 260px; height: 120px; border: 2px solid #e42112;}.update{ width: 280px; height: 120px; border: 2px solid #e42112; text-align: center; margin: 10px auto; padding-top: 20px;}
阅读全文
0 0
- angularJs 表格添加删除修改查询
- angularjs-查询.删除,添加数据,修改密码
- angularJs表格添加删除
- AngularJS查询,删除,添加
- angularJs添加,删除,查询
- angularjs 删除 查询 添加
- AngularJs查询,添加,修改
- AngularJs查询,添加,修改
- AngularJS 用户名查询、年龄查询、性别查询、全部删除、批量删除、添加用户、修改密码
- angularjs 可添加+修改+删除
- AngularJS添加删除查询排序
- AngularJS 查询 删除 增加 修改
- 使用AngularJS修改、删除表格数据
- AngularJS 查询、全选、反选、全部删除、批量删除、添加、修改
- AngularJS综合用户信息, 表单验证,过滤查询,全选反选,批量删除,修改,添加
- 使用angularjs 添加,查询,删除操作
- angularJS 增加 删除 修改 查询 排序
- AngularJS+用户查询+添加用户+修改密码
- VirtualBox中安装CentOS 7
- Hello Dubbo
- oracle11.2.0.4.0 配置dg(lgwr+async)笔记
- MySQL删除列,添加列的sql语句
- Unity获取模型的顶点坐标
- angularJs 表格添加删除修改查询
- 深度解析vivoX20四大创新突破!小米Mix2望尘莫及,雷军慌了
- CteX与LaTeX有什么区别
- Python numpy函数:hstack()、vstack()、stack()、dstack()、vsplit()、concatenate()
- win10激活失败遇到了0x8007007B错误
- 互斥量、临界区、信号量、事件标志组和消息邮箱
- 线程和进程的区别
- excel中如何实现在年龄一栏加1即让某列数字分别加1
- Mac:jenkins忘记管理员账号登录密码如何修改管理员账号