Skip to content

Commit 9d72e59

Browse files
committed
Merge pull request #7 from jderusse/fix-collection-purge
Revert remove order to avoid to skip indexes
2 parents 912e37e + eccbbf1 commit 9d72e59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/model/collection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function $CollectionFactory (BaseModel) {
3737
},
3838
set: function (models, options) {
3939
var i;
40-
for (i = 0; i < this.models.length; i++) {
40+
for (i=this.models.length-1; i>=0; i--) {
4141
this.removeIndex(i);
4242
}
4343

0 commit comments

Comments
 (0)