angular7 - 如何在 Router 和 NAvControl 中使用 ionic 4 中的前一个组件
问题描述
我使用以下代码使用了以前的 URL,(参考来自: https ://community.wia.io/d/22-access-the-previous-route-in-your-angular-5-app )
this.router.events.subscribe((event) => {
this.currentUrl = this.router.url;
if (event instanceof NavigationEnd) {
this.previousUrl = this.currentUrl;
this.currentUrl = event.url;
}
});
但我想采用与 ionic 3(this.navController.getPrevious()) 类似的先前组件。我在 ionic 4 中找不到任何方法
我已经用谷歌搜索并搜索了角度帖子,但无法获得正确的结果。提前致谢。
解决方案
推荐阅读
- python - DataFrame 无法迭代:出现以下错误:元组索引必须是整数或切片,而不是 str
- msbuild - 在 Visual Studio 2017 中,有没有办法编译使用外部工具的自定义扩展,同时调试程序?
- oracle - 将employeeno 作为参数传递给程序并修改该员工的薪水?
- python - Spark:如果已经通过 `--py-files` 选项传递,slave 是否应该有源代码?
- python - 从Django中的模型类生成可迭代的选择元组
- c# - HTTP 触发器不返回 Azure Functions v2 中的堆栈跟踪
- c# - C# 如何更新 Azure IoT 中心设备的所需孪生属性
- excel - 我的 excel 文件的正确 if 条件是什么?
- sql - 连接表中的错误:传递给 LEFT 或 SUBSTRING 函数的长度参数无效
- azure - IIS Web App Deploy - Azure DevOps Release 任务部署 wwwroot 中存在的所有文件