Closed AKhileshPothuri closed 4 years ago
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.
@AKhileshPothuri Can you post the exact error screenshot that showed in console.
addFavouriteProduct(data: Product): void {
-->>> this.favouriteProducts.push(data);
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.