Flask接口签名sign原理与实例代码浅析
291
2023-03-23
Angular搜索 过滤 批量删除 添加 表单验证功能集锦(实例代码)
废话不多说了,直接给大家贴代码,具体代码如下所示;
*{
margin: 0;
padding: 0;
}
.sspan{
background: #28a54c;
color: #fff;
margin-left: 5px;
}
th,td{
border: 1px solid #000;
padding: 10px;
}
table{
text-align: center;
width: auto;
border-collapse: collapse;
}
button{
margin-top: 10px;
margin-bottom: 10px;
}
-
id 商品名 用户名 手机号 价格 城市 下单时间 状态
*请输入邮箱 ng-show="registerForm.email.$error.email">*请输入正确的email地址
ng-show="registerForm.email.$error.email">*请输入正确的email地址
*请输入姓名
ng-minlength="6" ng-maxlength="20" name="password" id="password"
placeholder="请输入密码..." required>
*密码长度不小于6
*密码长度不超过20
class="form-control" ng-model="passwordagain" name="passwordagain"
id="passwordagain" placeholder="请再输一遍密码..." required>
*两次密码输入不一致
ng-disabled="registerForm.email.$invalid || registerForm.name.$invalid || registerForm.password.$invalid || password != passwordagain">
提交
var app = angular.module("myapp",[]);
app.controller("myCtrl",function ($scope) {
$scope.data = [
{ commodity:"iPhone4",
name:"张三",
phone:151111111,
price:4999,
city:"北京",
order:"8-1",
state:"发货",
done:false
},
{ commodity:"小米6",
name:"李四",
phone:15222222,
price:2999,
city:"北京",
order:"8-2",
state:"发货",
done:false
},
{ commodity:"华为P9",
name:"王五",
phone:153333333,
price:3999,
city:"上海",
order:"9-3",
state:"已发货",
done:false
},
{ commodity:"OPPO R11",
name:"赵六",
phone:15444444,
price:4999,
city:"天津",
order:"9-4",
state:"已发货",
done:false
},
{ commodity:"ViVo",
name:"钱七",
phone:155555555,
price:2999,
city:"重庆",
order:"10-4",
state:"已发货",
done:false
}
];
$scope.Choicecity = "选择城市";
$scope.cityFun = function (item) {
if($scope.Choicecity != "选择城市"){
if( item.city == $scope.Choicecity){
return true;
}else {
return false;
}
}else {
return true;
}
};
$scope.Choicestate = "选择状态";
$scope.stateFun = function (item) {
if($scope.Choicestate != "选择状态"){
if(item.state == $scope.Choicestate){
return true;
}else {
return false;
}
}else {
return true;
}
};
$scope.pl = "已发货";
$scope.fahuo = function (index) {
if($scope.data[index].state=="发货"){
$scope.data[index].state =$scope.pl;
}
};
$scope.Choiceorder = "开始月份";
$scope.orderFun = function (item) {
if($scope.Choiceorder != "开始月份"){
var arr = $scope.order.split("-");
var min = arr[0];
var max = arr[1];
if(item.order >= min){
return false;
}else {
return true;
}
}else {
return true;
}
}
$scope.quan = function () {
if($scope.checkAll == true){
for(var i = 0 ; i <$scope.data.length ; i++){
$scope.data[i].done = true;
}
}else{
for(var i = 0 ; i <$scope.data.length ; i++){
$scope.data[i].done = false;
}
}
};
$scope.plsc = function () {
for(var i = 0 ; i <$scope.data.length ; i++){
if($scope.data[i].done == true){
$scope.data.splice(i,1);
i--;
}
}
};
$scope.tj = false;
$scope.tianjia = function () {
$scope.tj = true;
};
$scope.error = false;
$scope.tijiaola = function () {
if($scope.commoditys==null||$scope.names==null||
$scope.commoditys<6||$scope.commoditys.length>20){
$scope.error = true;
}
};
$scope.dd = false;
$scope.cc = "id";
$scope.sort = function (couldm) {
if($scope.cc == couldm ){
$scope.dd =! $scope.dd;
}
$scope.cc = couldm;
}
$scope.tianjiapp = function () {
$scope.data.push({commodity:$scope.email,name:$scope.name,phone:$scope.password})
}
})
总结
以上所述是给大家介绍的Angular搜索 过滤 批量删除 添加 表单验证功能集锦(实例代码),希望对大家有所帮助,如果大家有任何疑问请给我留言,会及时回复大家的。在此也非常感谢大家对我们网站的支持!
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~