In Angular application, OnInit lifecycle event working each time when I open these pages.
And it is fine. I should edit an item on ItemDetailsComponent, and after clicking back to IndexComponent I see new information.
I start an Ionic project. Changed router-outlet to ion-router-outlet
Same structure, same routing.
And now:
IndexComponent OnInit working the only first time. When I back to this page from ItemDetailsComponent - OnInit not rerun. Ionic reuse IndexComponent, But I need a new instance.
ItemDetailsComponent OnInit working the only first time for each item in the items list.
But if I edit an item, return back to IndexComponent, update items handly(click a button, because OnInit not work). And open ItemDetailsComponent again - I see old information because OnInit not firing - this is an old instance.
Bug Report
Ionic version: [x] 4.1.0
Current behavior: Ionic router run OnInit only first time
Expected behavior: Run OnInit each time
I have an app with Angular. It is a simple list of items, after clicking on an item opened item details page. Two routes:
I use ItemsService -> get/save items.
In Angular application, OnInit lifecycle event working each time when I open these pages. And it is fine. I should edit an item on ItemDetailsComponent, and after clicking back to IndexComponent I see new information.
I start an Ionic project. Changed
router-outlet
toion-router-outlet
Same structure, same routing. And now:IndexComponent OnInit working the only first time. When I back to this page from ItemDetailsComponent - OnInit not rerun. Ionic reuse IndexComponent, But I need a new instance.
ItemDetailsComponent OnInit working the only first time for each item in the items list. But if I edit an item, return back to IndexComponent, update items handly(click a button, because OnInit not work). And open ItemDetailsComponent again - I see old information because OnInit not firing - this is an old instance.