Hi,
I’m trying to change the todos MVC example to have a resource that returns an instance instead of a list:
Current code:
var AppViewModel = DefineMap.extend("AppViewModel",{
appName: "string",
todosList: {
get: function(lastSet, resolve){
Todo.getList({}).then(resolve);
}
}
});
Modified code:
var AppViewModel = DefineMap.extend("AppViewModel",{
appName: "string",
oneTodo: {
get: function(resolve){
Todo.get().then(resolve);
}
}
});
fixture("/api/todos", function() {
return { name: "mow lawn", complete: false, id: 5 };
});
proto-compute.js:357 Uncaught RangeError: Maximum call stack size exceeded
at Compute.get (proto-compute.js:357)
at Object.compute (can-compute.js:60)
at AppViewModel.eval (can-define.js:512)
at AppViewModel.get todos (index.js:58)
at Compute._get (proto-compute.js:275)
at Compute.get (proto-compute.js:379)
at Object.compute (can-compute.js:60)
at AppViewModel.eval (can-define.js:512)
at AppViewModel.get todos (index.js:58)
at Compute._get (proto-compute.js:275)
Does anyone knows how to do this ?
Thanks,
Nuno