Angular.js $http.post TypeError: Cannot read property 'data' of undefined
问题 Angular.js v1.0.6 When making an $http.post and receiving a non 200 resposne (401 in this case) $http.post('http://localhost:3030/auth/login', { username: 'username', password: 'password' }) .success(function(data) { // Gets called on a 200 response, but not on a 401 console.log('success'); }) .error(function(err) { // Never gets called & dies with error described below. console.log('error'); }); Angular throws the following error: TypeError: Cannot read property 'data' of undefined at http:/