也许你们其中一个人知道我们的angularjs应用程序出了什么问题(不幸的是我无法分享代码)。
我们做什么:
有人为我们提供线索吗?
答案 0 :(得分:0)
你是如何触发$ location.search()函数的?
听起来你可能需要在触发$ location.search()之后调用$ scope。$ digest()但我无法用你的例子说出来。
答案 1 :(得分:0)
请参阅$ location.search如何工作的这个工作示例:
var myApp = angular.module('myApp', []);
function MyCtrl($scope, $location) {
$scope.location = $location;
$scope.$watch('location.search()', function() {
$scope.target = ($location.search()).target;
}, true);
$scope.changeTarget = function(name) {
$location.search('target', name);
}
}
https://jsfiddle.net/pvffcfq6/
您可能需要在代码中的某处运行$ scope.digest吗?