can not fetch a model - trigger a GET
Closed this issue · 2 comments
subzerodigital commented
Hey there, thanks for the brilliant plugin,
here's my code
var Job = Backbone.NestedModel.extend({
defaults:{
}
...
})
var JobCol = Backbone.Collection.extend({
model:Job,
url:"jobs",
localStorage: new Backbone.LocalStorage("jobs")
});
the problem is:
when I try to fetch the model
var job = new Job({id:id});
job.fetch()
it still trigger a GET quest,
So what would be the best way to fetch a model?
subzerodigital commented
I know I can fetch the whole collection first then get the model by id:
var jobs = new JobCol();
jobs.fetch();
job = jobs.get(id);
but, do we have a way to fetch the model directly instead fetch the collection every time?
Thanks very much!