Well I didn't find anyone else listing this problem so I'm sure I'm misunderstanding the doc but can't figure what I'm doing wrong.
I'm trying to get a subclass of a model created based on the examples on the canJs site and eventually get it hooked up to a fixture to simulate the loading of data.
This is what I'm doing:
1) constructed a fixture for the url
note that the problem occurs whether fixture was created or not
2) constructed model base class with can.Model()
var moptions1 =
{
findAll: "GET /todos",
findOne: "GET /todos/{id}",
create: "POST /todos",
update: "PUT /todos/{id}",
destroy: "DELETE /todos/{id}",
tdee: "amTdee",
1) constructed a fixture for the url
note that the problem occurs whether fixture was created or not
2) constructed model base class with can.Model()
var moptions1 =
{
findAll: "GET /todos",
findOne: "GET /todos/{id}",
create: "POST /todos",
update: "PUT /todos/{id}",
destroy: "DELETE /todos/{id}",
tdee: "amTdee",
};
var moptions2 =
{
tdum: "amTdum"
};
var CustDtlModel = can.Model( moptions1, moptions2 );
3) constructing new instance of derived model to load from fixture/server
var cm1 = new CustDtlModel();
4) cannot call cm1.findOne() because the method does not exist in the cm1 object or its prototype
var moptions2 =
{
tdum: "amTdum"
};
var CustDtlModel = can.Model( moptions1, moptions2 );
3) constructing new instance of derived model to load from fixture/server
var cm1 = new CustDtlModel();
4) cannot call cm1.findOne() because the method does not exist in the cm1 object or its prototype
what am I missing here?
Thanks for any help.
Rand.