【问题标题】:Pattern in production makes the form field and overall form invalid生产中的模式使表单域和整体表单无效
【发布时间】:2018-07-03 14:17:00
【问题描述】:

我在 ionic-angular 项目中使用模板驱动表单。

<input type="password" ngModel required name="password" pattern="(?=.*\[0-9])(?=.*\[a-z]).{6,}"></input>

上述输入字段在开发模式下工作正常。但在生产中显示为无效。

如果我在开发中输入“aaaaaaa@123”,密码字段的值是有效的,而在生产中相同的值将变为无效。

【问题讨论】:

    标签: angular ionic2 angular2-forms production dev-to-production


    【解决方案1】:

    尝试从您的正则表达式中删除反斜杠转义字符。它应该是这样的:

    (?=.*[0-9])(?=.*[a-z]).{6,}
    

    【讨论】:

      猜你喜欢
      • 2017-07-26
      • 2014-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多