Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html angularjs:强制重新加载某些链接路径的最佳方法_Html_Angularjs_Routes - Fatal编程技术网

Html angularjs:强制重新加载某些链接路径的最佳方法

Html angularjs:强制重新加载某些链接路径的最佳方法,html,angularjs,routes,Html,Angularjs,Routes,我希望能够在我的站点中捕获以/@开头的任何链接,并处理完整的浏览器重新加载 比如: $locationProvider.html5Mode(true) $routeProvider.when("/@:id", # window.location.href = [the link's url] # all others are handled by typical controller/view 我已经能够在锚标记上使用属性/指令来解决这个问题,但是我希望在url路由级别上这样做 我不确

我希望能够在我的站点中捕获以/@开头的任何链接,并处理完整的浏览器重新加载

比如:

$locationProvider.html5Mode(true)
$routeProvider.when("/@:id",
  # window.location.href = [the link's url]
  # all others are handled by typical controller/view

我已经能够在锚标记上使用属性/指令来解决这个问题,但是我希望在url路由级别上这样做

我不确定这是否是最好的解决方案,但您可以根据当前时间而不是“/@”代码设置参数

e、 g

这可能会有所改进,但正在发挥作用


您还可以查看一下

这并不是您问题的真正答案,但您可以按照中的建议将target=\u self添加到您的链接中
<a href="/Customer/Edit/{{customer.id}}&refresh={{now}}">{{customer.Name}}</a>
$rootScope.$on('$routeChangeSuccess', function (event, current, previous) {
$rootScope.now = Date.now();
});