attach() {
    if (!this.element.attributeListeners) this.element.attributeListeners = [];
    this.element.attributeListeners.push(this);
    this.listener.onValueChange(this.handleValueChange);
    this.attached = true;

    if (this.attributeKey === 'model') {
      if (/(checkbox|radio)/.test(this.element.getAttribute('type'))) {
        this.element.onchange = (e) => {
          this.listener.component[this.listener.key] = e.target.checked;
        };
      } else {
        this.element.oninput = (e) => {
          this.listener.component[this.listener.key] = e.target.value;
        };
      }
    }
    return this;
  }
Attaches attribute listener to given element and starts listening.
@returns {AttributeListener}