0

I have just started using Native script & Angular for developing apps. I opted for google firebase as by database source. I have managed to migrate my SQL data to firebase real-time database. I can retrieve the data from the json table fine. Now my question in terms of Login and Registration, can I query the username and passwords for logging in or do I have to use Firebase Authentication option with the email and password

georgeawg
  • 48,608
  • 13
  • 72
  • 95
codex
  • 1
  • 5

1 Answers1

0

I am looping values from my firebase database using objectKey technique.

uid:fcnb8wD7ZdgqfBYrUVUfW5Z1Azm2
 {
   "zcash_": 1.32569,
   "machine": true,
   "litecoin": 5.3655,
   "decred": 6.25663,
  "btc": 0.2364144
 }

I m retrieving the BTC value. It returns the value but appends undefined twice before it shows the value I need. how can I eliminate the undefined values

 firebase.getValue(`/machinelist/${userID}`)
      .then(
        result =>   Object.keys(result).forEach(key => {
var balance= result[key]['btc'];
console.log(balance);
        }
      )
      .catch(error => console.log("Error: " + error));

This is how i am iterating my json object

codex
  • 1
  • 5