title: How to get error message from web api in angular?
body: <p>How can i get error message returned by web api in Angular. </p>
  
  <p>This is what I have got in fiddler</p>
  
  <pre><code>{"Message":"The request is invalid.","ModelState":{"":["Name test1 is already taken."]}}
  
   ()''
  </code></pre>
  
  <p>what do i change in error function to show just 'Name test1 is already taken'?
  This is Angular http post. </p>
  
  <pre><code>        $http({
              method: 'POST',
              url: 'api/Account/Register',
              data: { 'UserName': user.username, 'Password': user.password, 'ConfirmPassword': user.confirmpassword, 'Email': user.email },
          })
          .success(function () {
              toastr.success('successfully registered. ');                        
          })
          .error(function (error) {           
              toastr.error('error:' + error);                
          });
  </code></pre>