I’m not getting through Firebase

Asked

Viewed 14 times

0

var inputEmail = Document.getElementById('inputEmail'); var inputName = Document.getElementById('inputName'); var addBtn = Document.getElementById('addBtn');

//By clicking the button addBtn.addeventlistener('click', Function() { create(inputEmail.value, inputName.value); });

Function create(name, email) { var data = { name: name, email: email }; Return firebase.db(). ref(). Child(). push(date); }

<form>
                      <div class="form-group">
                          <label for="inputEmail">Email</label>
                          <input type="email" class="form-control" id="inputEmail" placeholder="Email">
                      </div>
                      <div class="form-group">
                          <label for="inputName">Nome</label>
                          <input type="text" class="form-control" id="inputName" placeholder="Nome">
                      </div>
                      <button class="btn btn-lg btn-success btn-block text-uppercase" id="addBtn">Acessar</button>
                  </form>
                </div>
            </div>
          </div>
    </div>
    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
    <script src="https://www.gstatic.com/firebasejs/5.10.1/firebase.js"></script>
    <script src="js/app.js"></script>
    <script src="js/real-time-db.js"></script>
</body>
</html>

I’m trying to send the user name and email to firebase DB, but it’s not going. The auth configuration is true and all links and cdns are there. I don’t know what’s going wrong.

  • auth has nothing to do with Database, in your case, you make a statement in this firebase.db(). ref(). Child(). push(data); try firebase.db(). ref('/'). Child('users'). push(data);

  • I got it, thanks

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.