$scope.fetch =function()
{
$http(req)
.success(function(data,status,headers,config){
if(status==0)
{
console.log(data);
console.log(status);
else{
.error(function(response,status,headers,config) {
console.log("error");
console.log(headers);
console.log(fd);
});
What i mean is if status is 0 i would like to print that status is zero else it comes to the error block and prints a alert msg.I tried like above but unable to correct the syntax.