title: Add Delay in angularjs
body: <p>I want to add some delay in angularjs. So that it can fetch data from api. Because my api is heavy. I am calling this function. Basically i want some delay to load page so that my api work properly. I tried some time my data pull immediate some time i am getting error. When i refresh my page it work fine.</p>
  
  <pre><code>      Help to put $timeout function in this angularjs
    // Geting test stuff
      $scope.teststuff = function () {
  $scope.loading = true;
  $http.get(settings.WebApiBaseUrl + 'Api/testing')           
     .success(function (data) {
          $scope.mydata = data;
          $scope.loading = false;
      }).error(function (data, status, headers, config) {
          alert("Error " + status )             
    $scope.loading = false;
      })      
  </code></pre>
  
  <p>}</p>