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