title: $timeout.cancel not working
body: <p>I am trying to cancel $timeout in the code snippet shown below, but it doesn't seems to be working. </p>
  
  <pre><code>            var trial=1;
          $scope.trialTimeout = $timeout(countdownTime,0);
  
          function countdownTime(){
              $timeout(function(){
                  trial++;
                  console.log("countdownTime");
                  if(trial&gt;2)
                      {
                          callMe();
                      }
                  countdownTime();
              },1000)
          }
  
          function callMe(){
              console.log("This "+$timeout.cancel($scope.trialTimeout));
              //$timeout.cancel(trialTimeout);
  
          }
  </code></pre>
  
  <p>When I log<code>$timout.cancel($scope.trialTimeout)</code> it returns false which means that its not cancelling the the timeout. The $scope.trialTimeout gives a promise object but still, its unable to cancel the timeout. </p>