阅读背景:

路由更改后,AngularJS $ interval函数继续

来源:互联网 

I have a function inside a controller which is based on setInterval. I noticed that after first calling it, it worked fine but continued even after the route changed. Afterwards i tried using the native $interval service which would automatically track changes in scope. The problem however remains. So now i have two questions. The first one is what can i do so that i use a repeated function inside a specific controller that stops when the user leaves that route? Also why does the scope function continue since i've changed scopes?I have a function inside a controller which is




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: