秦小小樱

导航

angular 定时函数

注入$interval,$timeout   服务

2.定义函数    

var aa = $interval(function(){
    $timout(function(){
      .....
})
},,定时时间毫秒单位)

//离开页面时关闭定时函数
$scope.$on("destory",function(){
   $interval.cancel(aa ); 
})

 

posted on 2018-08-24 10:47  RonnieQin  阅读(555)  评论(0编辑  收藏  举报