how to call function every 2 mins

后端 未结 5 1376
野的像风
野的像风 2021-01-17 16:30

how to call a save function every two mins in anular js. please Help me.

 $scope.save = function () {
        $http({
        url : \'/api/products\',
             


        
5条回答
  •  执笔经年
    2021-01-17 17:03

    you can use setInteraval function to call your function every 120000 milliseconds.

    setInterval(function(){
      $scope.save();
    }, 120000)
    

提交回复
热议问题