I want to change some values in an array after I subscribe to it.
this.data = this.search.getProductsById(this.id).subscribe
((data: any) => {
this.list = data;
//Here for each price I want to change price value
for (let entry of this.list.deals.new) {
if (entry.country == 'UK') {
let p = entry.price * 1.10837; //here I change price
console.log(p); //displays new price
}
}
this.loading = true;
});
But in HTML it displays old price, not p. How to change it so I would get in html new one ?
htmlcode?letyou are creating a new variable and aren't assigning it to anything. Changing the value would be done by doing something likeentry.price = entry.price * 1.10837;