getProducts(id) {
this.productRef.once(‘value’, (snap) => {
this.products = [];
if (snap.val()) {
var tempProducts = snap.val();
for (var key in tempProducts) {
let singleProduct = {
id:key,
menuid: tempProducts[key].MenuId,
name: tempProducts[key].Name,
//images:tempProducts[key].Image,
price:tempProducts[key].Price,
//rating:tempProducts[key].rating,
//sale_price:tempProducts[key].sale_price,
description:tempProducts[key].Description,
image:tempProducts[key].Image
};
this.products.push(singleProduct);
}
}
this.events.publish('productsLoaded');
}
);
this is my actual code in .ts,
how i can get specific data from firebase ,
i need to get products that matches id wit MenuId,