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

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -