我正在使用routeUpdate来观察搜索是否发生了变化:
$scope.$on('$routeUpdate', function (next, current) {
$scope.updatePointDetails($scope.point.Id, moment($scope.date).format('YYYY-MM-DD'));
...
});
我可以查看搜索中的哪个参数已更改,或者可能是旧值和新值?
答案 0 :(得分:0)
查看源代码,调用$ routeUpdate:
$rootScope.$broadcast('$routeUpdate', last);
last
是最后一条路线。这有你可以检查的params
对象。
检查是否:
$scope.$on('$routeUpdate', function (last) {
//check last.params has the old values
})