[Answer]-Django-angular, display servor-side error

1๐Ÿ‘

โœ…

Ok, not even a comment. But I found my own answer. You need to add an error callback in he save like this one:

new_inputfile.$save(
   function(){
     // success callback    
   },
   function(data) {
     djangoForm.setErrors(
        $scope.my_form, data.data.detail);
   }
 );

And you need to add djangoForm in your dependencies. This point is not detailled in the docs but mentionned from times to times through examples. Cheers guyz

๐Ÿ‘คabrunet

Leave a comment