Pushing Favourite Product to firebase
AKhileshPothuri opened this issue · 1 comments
AKhileshPothuri commented
addFavouriteProduct(data: Product): void {
let a: Product[];
-->>> this.favouriteProducts.push(data);
a = JSON.parse(localStorage.getItem('avf_item')) || [];
a.push(data);
this.toastrService.wait('Adding Product', 'Adding Product as Favourite');
setTimeout(() => {
localStorage.setItem('avf_item', JSON.stringify(a));
this.calculateLocalFavProdCounts();
}, 1500);
}
I was trying to push the favourite items of the users to the database. But I'm getting an error at the line I represented with an '-->'.. Could you please help me with that.
ikismail commented
@AKhileshPothuri Can you post the exact error screenshot that showed in console.