Category : refresh

I have created two Angular components: one for creating a new post and one for displaying all posts. After I press the button for creating a post I am being redirected to my PostList component, where all my posts are displayed. I used window.location.href, so that the PostList page can reload automatically, so that the ..

Read more

ngOnInit() { this.showcart.cart(1001).subscribe(res=>{ if(res==="No Product in Cart") { alert("No Products in Cart") this.router.navigate([‘Product’]); } else if(res.length<1){ alert("No Products in Cart") this.router.navigate([‘Product’]); } else{ this.itemcart=res as Showcart[]; } this.itemcart.forEach(item=>{ this.cartTotal+=item.Quantity*item.Price }) }) } In this code i am calculating my total value But after increasing and decreasing quantity value value is not refreshing Source: Angular..

Read more

I implemented a functionality in angular, Where i’m showing the filtered array details in grid. on clicking a button in grid, i’m calling a function onAcceptClick() whre we can update the record. When the record is updated, i need to refresh the filtered array, without reloading the page. Help me achieve this functionality. selected:any; filtered ..

Read more