title: Angular Js Callback Function For $timeout
body: <p>I have that line of codes</p>
  
  <pre><code>...
  $timeout(tempFunc, $scope.sync.getDelay());
  ...
  </code></pre>
  
  <p>at my temp function I have that line of code at end:</p>
  
  <pre><code>$scope.sync.releasePrivilege();
  </code></pre>
  
  <p>and everything works well. However when I try:</p>
  
  <pre><code>...
  $timeout(tempFunc, $scope.sync.getDelay());
  $scope.sync.releasePrivilege();
  ...
  </code></pre>
  
  <p>It doesn't. I think that I should write that line as a callback function into timeout. I don't want to change recent functions at my code I can just edit that lines. </p>
  
  <p>Any ideas?</p>
  
  <p><strong>PS:</strong> The problem is that: </p>
  
  <blockquote>
    <p>$scope.sync.releasePrivilege();</p>
  </blockquote>
  
  <p>is not running after timeout, it immediately runs.</p>