I am having trouble understanding how to correctly implement the can.Model service methods. I currently have this
var Foo = can.Model({
findAll: "GET /service/Editor.svc/foo",
findOne: "GET /service/Editor.svc/foo/{id}",
create: 'POST /service/Editor.svc/foo"',
update: 'PUT /service/Editor.svc/foo"{id}',
destroy: 'DELETE /service/Editor.svc/foo"{id}'
},{});
I have looked at http://canjs.com/guides/Models.html and http://canjs.com/guides/Tutorial.html and CanJS Model findAll returns list of duplicate items
I guess what I don't understand is how the model works. Is the only thing I need for these methods the above declaration? when I try to run
var test = new Foo()
then foo.findAll({}, function(success){//dosomething}, function(xhr){//do something else})
I get TypeError: Object #<Constructor> has no method 'findAll'
What part of this framework am I missing?
For the record this interacts with a c# wcf service and which pulls json objects from a mongodb