this.fb.getShoppingItems().then(result =>{
this.exercises=result;
console.log("this exercise : ");
console.log(this.exercises);
})
I should list firebase data but getting error like below
Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
first pic is my firebase data structure and second one is console.log result.
in html , I should iterate over exercises came from firebase data(interval_time, name, rest_time, time)
I think I should iterate over . for each date node like 20170710/20170711 ... How can I do that?
For JavaScript I would do
firebase.database().ref("profile/user_id").on('value', function(snap){
snap.forEach(function(childNodes){
//This loop iterates over children of user_id
//childNodes.key is key of the children of userid such as (20170710)
//childNodes.val().name;
//childNodes.val().time;
//childNodes.val().rest_time;
//childNodes.val().interval_time;
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With