$ location.search不更新imediatly [英] $location.search is not updated imediatly

查看:440
本文介绍了$ location.search不更新imediatly的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的网址没有得到我每次设置时更新的问题。它以某种方式与该指令相连,因为在其他情况下,它的工作原理。

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.

所以我的问题是,对什么是 $ location.search(DD,VAL)靠,又是什么在等待,因为函数被调用,但是URL不会被更新。

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.

推荐答案

它等待消化。<​​/ P>

it waits for a digest..

$scope.$apply(function() {
   $location.search('dd', val)
})

这篇关于$ location.search不更新imediatly的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆