Note:对于遗留版本的AngularJS来说,这是一个合适的答案.有关更新版本,请参阅this question.
$scope.$on('$routeChangeStart', function($event, next, current) {
// ... you could trigger something here ...
});
以下事件也可用(它们的回调函数采用不同的参数):
See the $route docs.
还有另外两个undocumented项活动:
See What's the difference between $locationChangeSuccess and $locationChangeStart?