Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript AngularJS中的ng模式,用于仅挖掘显示解析错误的三个特殊字符_Javascript_Angularjs - Fatal编程技术网

Javascript AngularJS中的ng模式,用于仅挖掘显示解析错误的三个特殊字符

Javascript AngularJS中的ng模式,用于仅挖掘显示解析错误的三个特殊字符,javascript,angularjs,Javascript,Angularjs,首先,如果没有ng模式属性,则根本没有错误,因此可以肯定地说,问题只与ng模式有关。例如,我多次更改了patternExcludes变量 [^\s\$\^]+ /[^\s\$\^]/ /^[^\s\$\^]$/ 还有很多我能想到的其他变化。 当正则表达式为[^\\\$\^]+时,ng消息被正确处理,但问题是在Chrome的控制台中,我得到了一个错误:$parse:lexerr Lexer Error。所有其他变体都不起作用,有些变体隐藏/忽略解析错误 在身份验证控制器中 在signup.ht

首先,如果没有ng模式属性,则根本没有错误,因此可以肯定地说,问题只与ng模式有关。例如,我多次更改了
patternExcludes
变量

  • [^\s\$\^]+
  • /[^\s\$\^]/
  • /^[^\s\$\^]$/
还有很多我能想到的其他变化。 当正则表达式为
[^\\\$\^]+
时,ng消息被正确处理,但问题是在Chrome的
控制台中,我得到了一个
错误:$parse:lexerr Lexer Error
。所有其他变体都不起作用,有些变体隐藏/忽略解析错误

在身份验证控制器中 在signup.html中

也在signup.html中

密码必须不包含特殊字符

尝试从around passwordPattern中删除{{}}

patternExcludes = "[^\ \$\^]+";

// pattern automatically is wrapped with '/^' and '$/'
$scope.passwordPattern = patternExcludes;
<input data-ng-model="Password" data-ng-minlength="8" data-ng-maxlength="32" name="Password"
                           type="password" class="form-control" placeholder="Password"
                           ng-pattern="{{passwordPattern}}" required>
<div ng-messages="SignUpForm.Password.$error" ng-if="SignUpForm.Password.$dirty"
                         class="msgColor" role="alert">
                        <!--... omitted ng-messages-->
                        <div ng-message="pattern">Your Password must <strong>NOT</strong> contain special characters</div>
                    </div>