while reading docs of backbone i can’t understand how to add model to collection with option {at: index} and then get this model using
mycollection.at('index')?
When im doing
myCollection.add(myModel, {at: myindex});
then
myCollection.at(myindex)
returns undefined;
while reading docs of backbone i can’t understand how to add model to collection
Share
Based on what you’ve said, it could be that your collection just isn’t that long enough and your
myCollection.add(myModel, {at: myindex})isn’t able to splice it in.Some demo code to replicate your problem:
Maybe some sample code if this doesn’t describe the issue?