I am using ionic 4 and @angular/router": “8.1.2”.
I have an alert with an ok button. In the ok button handler I have this navigation:
handler: data => {
this.navCtrl.navigateForward("/communication/segment", { state: { page: TAB_VALUES.TASK } });
}
Somehow the first time after a refresh it works, but the second time when I try to navigate than the navigation is canceled. I already tried to dismiss the alert in the button handler and make the navigation in the onDidDismiss() event, but it has the same effect.
This is my console log when the navigation is canceled:
platform-browser.js:301 Router Event: NavigationStart
index.js:3757 NavigationStart(id: 7, url: ‘/communication/segment’)
index.js:3757 NavigationStart {id: 7, url: “/communication/segment”, navigationTrigger: “imperative”, restoredState: null}
platform-browser.js:301 Router Event: RoutesRecognized
index.js:3757 RoutesRecognized(id: 7, url: ‘/communication/segment’, urlAfterRedirects: ‘/communication/segment’, state: Route(url:‘’, path:‘’) { Route(url:‘communication’, path:‘communication’) { Route(url:‘segment’, path:‘segment’) { Route(url:‘’, path:‘’) } } } )
index.js:3757 RoutesRecognized {id: 7, url: “/communication/segment”, urlAfterRedirects: “/communication/segment”, state: RouterStateSnapshot}
platform-browser.js:301 Router Event: GuardsCheckStart
index.js:3757 GuardsCheckStart(id: 7, url: ‘/communication/segment’, urlAfterRedirects: ‘/communication/segment’, state: Route(url:‘’, path:‘’) { Route(url:‘communication’, path:‘communication’) { Route(url:‘segment’, path:‘segment’) { Route(url:‘’, path:‘’) } } } )
index.js:3757 GuardsCheckStart {id: 7, url: “/communication/segment”, urlAfterRedirects: “/communication/segment”, state: RouterStateSnapshot}
platform-browser.js:301 Router Event: GuardsCheckEnd
index.js:3757 GuardsCheckEnd(id: 7, url: ‘/communication/segment’, urlAfterRedirects: ‘/communication/segment’, state: Route(url:‘’, path:‘’) { Route(url:‘communication’, path:‘communication’) { Route(url:‘segment’, path:‘segment’) { Route(url:‘’, path:‘’) } } } , shouldActivate: false)
index.js:3757 GuardsCheckEnd {id: 7, url: “/communication/segment”, urlAfterRedirects: “/communication/segment”, state: RouterStateSnapshot, shouldActivate: false}
platform-browser.js:301 Router Event: NavigationCancel
index.js:3757 NavigationCancel(id: 7, url: ‘/communication/segment’)
index.js:3757 NavigationCancel {id: 7, url: “/communication/segment”, reason: “”}
Any idea? Thanks.