问题
I have a problem that my url doesn't get updated every time i set it. It is somehow connected with the directive, because in other cases it works.
So my question is, on what is the $location.search('dd', val)
depended on, what is it waiting for, because function gets called, but the url is not updated.
回答1:
it waits for a digest..
$scope.$apply(function() {
$location.search('dd', val)
})
来源:https://stackoverflow.com/questions/24572613/location-search-is-not-updated-imediatly