iceflow19 / polymerfire

Polymer3 version
MIT License
2 stars 6 forks source link

Help with auth :( #4

Open MarcusGV opened 5 years ago

MarcusGV commented 5 years ago

Hi, thanks a lot for sharing your webcomponents, Im trying to learn polymer3 and using your component, I get an error and cant find why :(, hope you can help me please :(

I create this simple component wich is importing yours :

`import {PolymerElement, html} from '@polymer/polymer/polymer-element'; import '@polymer/paper-button' import './datos/firebase-app' import './datos/firebase-auth'

class ComponenteP3 extends PolymerElement { static get properties() { return {

    }
}
static get template() {
    return html`
    <p>Probando componente</p>
    <firebase-app
    auth-domain="test-fff34.firebaseapp.com"
    database-url="https://test-fff34.firebaseio.com"
    api-key="AIzaSyDpHUzHxcF4XXpjbDUR0wJ-2OpobKrRUww"
    storage-bucket="test-fff34.appspot.com"
    messaging-sender-id="1049180123532">
  </firebase-app>

  <firebase-auth id="auth" user="{{user}}" provider="google" on-error="handleError">
  </firebase-auth>
  <paper-button raised on-click="autenticar">Autenticar</paper-button>
    `;
}

ready() {
    super.ready();
}

autenticar(){
    console.log('autenticando');
    this.$.auth.signInWithPopup()
    .then(function(response) {
      console.log('Logueado');
    })
    .catch(function(error) {
      console.log('Error al loguearse');
    });
}    

}

customElements.define('componente-p3', ComponenteP3);`

When I use it, I get this error, please, any suggestions?: error

iceflow19 commented 4 years ago

@MarcusGV Did it run without the polymerfire components?