Hi,
I need te refresh data when I redirect page. Let me explain
I have 2 pages;
“products” listing the products
“add-product” that creates products
When I create a product, I would like to go back to the list of products and update this list via the API
This is my button to go to
<ion-button color="light" fill="clear" [routerLink]="['/add-product']">
<ion-icon slot="icon-only" name="bag-add-outline"></ion-icon>
</ion-button>
Everything I tested to get back to my list
this.router.navigate([`/products`], {state: {reload: true}}).then();
this.navController.navigateRoot([`/products`], {state: {reload: true}}).then();
this.navController.back();
this.navController.navigateBack([`/products`]).then();
And on my products.page.ts I tried this but none work, they never get called
ngOnInit() {
console.log('ngOnInit', history.state);
this.load();
}
ionViewWillEnter(): void {
console.log('ionViewWillEnter', history.state);
}
ionViewDidEnter(): void {
console.log('ionViewDidEnter', history.state);
}
ngAfterViewInit(): void {
console.log('ngAfterViewInit', history.state);
}
How can i refresh my data please ?
1 post - 1 participant