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();
});