Ionic4 and angular version of your request is like this :
(Ionic4和您的请求的角度版本是这样的:)
this.router
.navigate(["/page1"], { replaceUrl: true })
.then(() => this.router.navigate(["/page2"]));
The logic is here as i understand.
(据我了解,这里的逻辑。)
Push page1 into history but navigate to page2 so if user pushes the back button it redirects to page1. (将page1推入历史记录,但导航至page2,因此,如果用户按“后退”按钮,它将重定向到page1。)
Here is the stackblitz sample. (这是stackblitz示例。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…