When a component button is clicked, the following method is executed.
async onClickButton() { await this.shoppingCartService.add(this.selectedOffer); this.router.navigate(['ShoppingCartComponent']); }
The data will be added to the shopping cart, but when you go to the next page, only the header will be displayed, the data will not be. This method works, and the next page will display correctly if you do not use async-wait. Force change detection using ChangeDetectorRef.detectChanges () and ApplicationRef.tick () is not affected. After exiting the next page, i.e. ShoppingCartComponent, the rendering is performed, and for a moment the data will be displayed. Any ideas what could go wrong?
source share