I am using ionic 3.10.3 my root page is loginPage then after user validation its redirect to HomeViewPage by as bellow
this.nav.setRoot(HomeViewPage);
no problem to now but in the HomeViewPage If the user click add button it must be redirect to NewItemPage I tried to use
this.nav.setRoot(NewItemPage, {itemID: _id, isNew: _isNew});
and
this.nav.push(NewItemPage, {itemID: _id, isNew: _isNew});
bellow is the new function
newItem(){
this.events.publish('apps:viewItem', this.handlerService.getNewID(), "1");
}
and this is the code in app.component.ts the receive event
this.events.subscribe('apps:viewItem', (_id, _isNew) => {
this.menu.close();
this.rootPage = NewItemPage;
this.nav.setRoot(NewItemPage, {itemID: _id, isNew: _isNew}).then(()=>{
this.nav.popToRoot();
}).catch(err=>{
alert("NewItemPage Error : " + err.toString());
});
});
but still in the HomeViewPage even i clicked the button many times but when I click back button it return to NewItemPage but now data exists.
Any help