8 Replies Latest reply on Jan 19, 2018 3:51 PM by aouellet RSS
    aouellet Newbie

    JS Timer Event Controlling Model Properties

    I am attempting to use a simple JS timer function to write values to a variable, which is then bound to the model property "ry"


    The idea being, I can click a button to call the function, the the model continuously rotates until the function is cleared.


    I created the "counter" parameter and bound it to the "ry" property, as well as defining the click events as their respective functions.


    However, the dev console shows that the value is not being stored in "counter" and is not showing as bound to "ry."


    My code looks like the below:



    $scope.set_timer = function(){

      $scope.app.params['counter'] = 0 ;


        $scope.app.params['counter'] ++;



      , 1000);


    $scope.stop_time = function(){

      $scope.app.params.time = clearInterval(time);




    Any help is greatly appreciated.