Difference between $interval and setInterval in AngularJs

后端 未结 2 906
说谎
说谎 2021-01-02 22:09

I\'m trying to understand what\'s the difference between $interval and setInterval. I have this test:

Dashboard.prototype.updateTotalAppointments = function(         


        
2条回答
  •  一整个雨季
    2021-01-02 22:47

    $interval is a wrap for setInterval AND $apply simultaneous. It make the update of scoped variables to be visible when occours on $interval. Also valid for $timeout

提交回复
热议问题