Evan You пре 12 година
родитељ
комит
dde0bc8d41
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      src/observer/array-augmentations.js

+ 3 - 0
src/observer/array-augmentations.js

@@ -102,6 +102,9 @@ _.define(arrayAugmentations, '$set', function (index, val) {
  */
 
 _.define(arrayAugmentations, '$remove', function (index) {
+  if (typeof index !== 'number') {
+    index = this.indexOf(index)
+  }
   if (index > -1) {
     return this.splice(index, 1)[0]
   }