angularjs - ngResource new instance error when call $query -


let's have $resource like:

var collections = $resource("http://somedomain/collections/:action", {   action: "@action" }); 

if create new instance

var mycollections = new collections() 

when

mycollections.$query(); 

i error:

typeerror: value.push not function 

now, response array expected , seems in order. if do

var mycollections = collections.query(); 

it works

any ideas why? doing wrong?

if you're using $resource in way, believe there no such thing $query(), query() no dollar sign in front of it. there $save() think can pretty confusing.

i wish documentation bit better on subject, 1 way see possible calls on object checking under prototype when console.log mycollections. that, , searching examples on web.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -