I am trying to return a value after i read the data from firebase but ai am not getting it right:
This is what i have:
bill = database.ref('/restaurant/' + orderTest.restaurantKey ).once('value').then(snapchot =>{
restaurantData = snapchot.val()
*some functions that make billTest to 0
billTest = 0;
return billTest;
});
What i get from that is this when i console log bill is this:
ZoneAwarePromise {__zone_symbol__state: null, __zone_symbol__value: Array(0)}
__zone_symbol__state: true
__zone_symbol__value: 0
Symbol(Symbol.toStringTag): (...)
__proto__: Object
but i want to get just the normal value of 0.
I know that i am doing something wrong, but i tried everything that i know. I am also a begginer so i am here asking for some help