angularjs - Angular $resource returns too many results -
i don't know if question makes sense i'm bit confused happening here myself, have service returns information offices. there seems nothing wrong , returns data this:
[ { "maincontact": { "phonenumbers":[ {"key":1,"number":"22555555","type":"mobile"} ], "key":1, "name":"ola dunk", "email":"oladunk@lol.no" }, "secretary": { "phonenumbers": [ { "key":2, "number":"22666666", "type":"home" } ], "key":2, "name":"kari norrmann", "email":"kari@test.no" }, "key":1, "specialrequirements":null, "name":"ola dunk", "address":"test", "doctorcount":10, "presumedpurchaseamount":100000, "phonenumber":"22222222", "membershipstatus":1 } ]
i tried using $resource data using
var r = $resource('http://localhost:60297/api/office'); console.log(r.query());
i use query() on get() since default service when no id specified or other selector. happens return 1 test office i've created because that's office exists presently.
my problem can see in console i've screenshotted here:
that's tip of iceberg. result keeps getting repeated. check tried using $http instead of $resource , works fine.
any ideas on what's wrong?
that's because object 'self-assigned', can try in console:
var test = { foo : 'bar'}; test.foo = test;
and same thing. question is: why bothers you?
Comments
Post a Comment