title: jquery ajax working fine but angular ajax not working
body: <p>I am making an AJAX call using jQuery and it works fine. However, when I use AngularJS to carry out the same AJAX request, I am fine as long as a success is returned. But, if an error occurs, no response is returned and the error is displayed in my browser console.</p>
  
  <p><strong>jQuery call:</strong>           </p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: myUrl,
      data: a javascript object,
      dataType: "json",               
      //if received a response from the server
      success: function(response) {
          console.log(response,'in success');
          callback(response)
      },
      error: function(response) {
          console.log(response.status,'in error');
          callback(response)
      }
  })
  </code></pre>
  
  <p><strong>AngularJS Call:</strong></p>
  
  <pre><code>$http({
      url: myUrl,
      method: "POST",
      data: $.param(javascriptObject),
      headers: {
          'Content-Type': 'application/x-www-form-urlencoded'
      },
  }).success(//reached Here in case of Success
      function(data, status, headers, config) {
          console.log(response,'in     success');
          callback(response)
  }).error(function(data, status, headers, config) {
      //Never Reached Here
      console.log(response.status,'in error');
      callback(response)
  });
  </code></pre>
  
  <p><strong>MyController:</strong>           </p>
  
  <pre><code>//some logic
  if(flag==false) {
      return Response.status(403).entity(msg).build();    
  } else {
      return Response.status(200).entity(msg).build();
  }
  </code></pre>