$location.search is not updated imediatly

余生长醉 提交于 2019-12-25 03:26:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!