title: In angular $http service, How can I catch the "status" of error?
body: <p>I'm reading a book called, "Pro Angular JS".
  However, I have a question about how to catch a status of error.</p>
  
  <p>What I coded is :</p>
  
  <pre><code>$http.get(dataUrl)
      .success(function (data){
          $scope.data.products = data;
      })
      .error(function (error){
          $scope.data.error=error;
          console.log($scope.data.error.status); // Undefined!
          // (This is the spot that I don't get it.)                                         
      });
  </code></pre>
  
  <p>If I code "console.log($scope.data.error.status);" , why does the argument of console.log is undefined?</p>
  
  <p>In the book, there are sentence, "The object passed to the error function defines status and message properties."</p>
  
  <p>So I did $scope.data.error.status</p>
  
  <p>Why is it wrong?</p>