angular.js - Login input judgment
仅有的幸福
仅有的幸福 2017-05-15 16:55:37
0
1
532
大家好,我遇到一个问题,在登录的module里面,我设置了一个属性Name,检查是否为空,可以这样写吗
<p> ng-model="loginBean.Name"</p>
 if ($scope.loginBean.mode === 'Account') {
            if (!$scope.loginBean.Name || !$.trim($scope.loginBean.Name).length) {
                updateFormError('NameRequire');//根据返回的错误代码,打印错误
                return false;//name 输入为空,false
            }
        }
仅有的幸福
仅有的幸福

reply all(1)
淡淡烟草味

1. If your username is special, such as email, phone number, etc., it is recommended to use regular expressions.
2. If your username only considers the length, this is OK. By the way, let’s also judge the maximum length.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template