angularjs提示框及正则表达式校验

来源:互联网 发布:热血江湖sf源码 编辑:程序博客网 时间:2024/06/05 10:39
vm.gobindphoneCertify = function () {  if(!vm.cardphone) {
//-----------提示框    var alertPopup = $ionicPopup.alert({      title: '提示!',      template: '手机号不能为空',      buttons: [        {          text: '<b>确定</b>',          type: 'button-positive'        },      ]    });
//--------------  }else {    var re = /^1\d{10}$/    if (re.test(vm.cardphone)) {      $state.go('cardphonecertify');    } else {      var alertPopup = $ionicPopup.alert({        title: '提示!',        template: '手机号格式不正确',        buttons: [          {            text: '<b>确定</b>',            type: 'button-positive'          },        ]      });    }  }};
0 0
原创粉丝点击