【发布时间】:2012-09-01 12:30:20
【问题描述】:
我只是想知道是否有办法知道是否有人正在更改 URL 的路由。
例如,我的 html 中有这样的内容:
<a ng-href="#/somewhere">To somewhere</a>
而我是使用这个:
$scope.$on('$routeChangeSuccess', function (scope, next, current) {
//Some code
})
但是,我刚刚意识到我需要在更改 URL 之前运行此代码。有没有办法做到这一点,并且有相同的 next 和 current 知道我将被重定向到哪里以及从哪里重定向?
【问题讨论】:
标签: angularjs routes angularjs-routing