首页 > 解决方案 > 如何从 BrowserPlatformLocation 扩展功能

问题描述

我正在寻找一种无需参数即可获取当前路线的方法。

例如,我找到了这个答案: Get current route without parameters

就像您看到的那样,有很多解决方法,但没有一个是简单明了的。

当我使用“ location.path()”时,我注意到它使用“ BrowserPlatformLocation.pathname()”,其中包含“没有参数的当前路由”。

所以问题是:

如何从“ BrowserPlatformLocation”扩展功能。

标签: angulartypescript

解决方案


推荐阅读