title: Angularjs Handle api timeout
body: <p>I need to throw error when api doesn't respond within 30 seconds.</p>
  
  <pre><code>$http.get("api/data.json",{timeout : 3000}).success(function(data){
              $scope.data = data;
          }).error(function(data) {
              console.log('api didnt respond in 30 seconds')
          });
  </code></pre>
  
  <p>But it doesnt land in the error block even after 30 seconds.
  I am new to angularjs. Please guide me.</p>