javascript - How get 400 Bad Request in variable -
i have answer rest - result = <400 bad request>
and want show error user using angularjs.
i have fuction in controller
$scope.update = function (id) { topic.get({id: id}, function (result) { $scope.name = result; $('#savetopicmodal').modal('show'); console.log(result); }); };
please - how error in variable , show variable. thank you
to access error have define error handler in description of angular $resource api.
$scope.error = error;
$scope.update = function (id) { topic.get({id: id}, function (result) { $scope.name = result; $('#savetopicmodal').modal('show'); console.log(result); }, function (error) { console.log(error); $scope.error = error; }); };
Comments
Post a Comment