Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$decode expected an object on model.$update #364

Open
jflobos opened this issue Jan 6, 2016 · 1 comment
Open

$decode expected an object on model.$update #364

jflobos opened this issue Jan 6, 2016 · 1 comment

Comments

@jflobos
Copy link

jflobos commented Jan 6, 2016

Hi,

I'm currently working with this great library, but I don't know why some models got this problem, currently I got a model that is defined like this.

angular.module('app.models')
  .factory('Password', function(restmod) {
    return restmod.singleton('/users/password', {}, {});
  });

In the controller I use:

Password.$update({user: passwordData}).$then(function(response) {
        deferred.resolve(response.$response.data);
      }, deferred.reject);

But when the controller is executed I got an $decode expected an object error

@utf4
Copy link

utf4 commented Nov 3, 2016

Your server is responding with the data which is either array or string or null but not json array. Did you looked into your developer's tool's network tab -> the response coming from the server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants