数据绑定密码模式不适用于纸张输入

data bind password pattern not working with paper-input

我正在尝试让密码模式与数据绑定一起工作。在下面的 jsbin 中,当 html 中提供模式时,密码 Pass5678 被接受。但是,当我使用 属性 绑定模式时,密码失败

http://jsbin.com/posojodozu/edit?html,output

代码:

<!doctype html>
<head>

  <meta charset="utf-8">

  <base href="http://polymer-magic-server.appspot.com/components/">

  <script src="webcomponentsjs/webcomponents-lite.min.js"></script>

  <link href="polymer/polymer.html" rel="import">
  <link href="iron-form/iron-form.html" rel="import">
  <link href="paper-input/paper-input.html" rel="import">


  <style>
    body {
      font-family: sans-serif;
    }
  </style>

</head>
<body>

<x-example></x-example>

<dom-module id="x-example">
  <style>
    :host {
      display: block;
      padding: 36px;
    }


  </style>
  <template>


    <form is="iron-form"
      id="form"
      disable-native-validation-ui
      action="/">
      <paper-input
        name="password"
        required
        type="password"
        pattern="[[passwordPattern]]"
        label="Enter Password"></paper-input>
      <br>  
      <button type="submit">SUBMIT</button>  
    </form>

  </template>
  <script>

    // only need this when both (1) in the main document and (2) on non-Chrome browsers
    addEventListener('WebComponentsReady', function() {

      Polymer({
        is: 'x-example',
        properties: {
          passwordPattern: {
            type: String,
            value: '(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,16}'
          }
        }
      });
    });

  </script>
</dom-module>

</body>

看起来斜杠被以某种方式删除了,所以值应该是:

value: '(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,16}'