AngularJS service not invoking error callback on save() method

前端 未结 6 2169
伪装坚强ぢ
伪装坚强ぢ 2021-01-17 18:07

So I\'m using angularjs restful service $resource and I\'m calling $save function. However, the error callback I pass to it is not being called. The server is sending a 41

6条回答
  •  遇见更好的自我
    2021-01-17 18:37

    Actually if we follow the documentation. it works

     User.save(vm.user, function (response) {
                  FlashService.Success('Registration successful', true);
                  $location.path('/login');
          },
          function (response) {
    
              FlashService.Error(response.data);
              vm.dataLoading = false;
    
          });
    

    above is snip from my code it works.

提交回复
热议问题