google 聚合物和 firebase 文档更改数据 javascript?

google polymer and firebase document change data with javascript?

我正在使用 Polymer 构建一个网络应用程序,我正在使用 firebase 作为数据库。我想建立一个用户电子邮件确认网站。 -> 当网站打开时,应该更新一个简单的 firebase 节点。我的 email-confirmahtml:

<dom-module id="email-confirmation">
    <template>
      <firebase-document
        id="idd"
        location="[[location]]"
        data="{{userToConfirm}}"
        on-data-changed="callMe">
      </firebase-document>

      <template is="dom-if" if="{{isConfirmed(userToConfirm)}}">
        <p>It worked!</p>
      </template>
    </template>
  <script src="./email-confirmation.js"></script>
</dom-module>

和我的 email-confirmation.js:

class EmailConfirmation {
  beforeRegister() {
    this.is = 'email-confirmation';
    this.properties = {
      /**
       * Defines the email, that will be confirmed.
       */
      email: {
        type: String
      }
    };
    this.observers = [
      // Note that this function  will not fire until *all* parameters
      // given have been set to something other than `undefined`
      'attributesReady(email)'
    ];
  }

  attributesReady(email) {
    this.location = document.createElement('iron-meta').byKey('firebaseLocation') + 'users/' + email;
  }

  isConfirmed(bla) {
    this.userToConfirm.confirmed = true;
    bla.confirmed = true;
    return true;
  }

  callMe(event, values) {
    this.userToConfirm.confirmed = true;
    event.detail.value.confirmed = true;
    event.currentTarget.data.confirmed = true;
    this.$.idd.data = true;
    values.value.confirmed = true;
  }
}

如您所见,我在这里尝试使用不同的方法。但是 none 这个调用实际上更新了我的 firebase 节点!我应该如何使用 javascript 更新我的节点?[​​=14=]

我还认为通知 firebase-document 值已更改可能存在问题。我试图触发一个事件,但它们似乎没有达到 firebase-document。 (可能是因为事件没有触发给孩子们)

亲切的问候 马克

尝试使用 query 属性 this.$.idd.query.set('confirmed', true);