我将 $window.location
替换为 $location.search
以避免在每次页面转换时显示加载指示器。
我不知道如何替换下面的指令以返回上一页:
$window.history.go(-1);
$location
也有变体吗?
最佳答案
不,根据 Angular 文档:
The $location service parses the URL in the browser address bar (based on the window.location)
这绝不会让历史记录可供 $location 服务使用,并由 $location API doc 确认。
关于javascript - 如何使用 $location.search 转到上一页?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47554046/