Просмотр исходного кода

fix directive teardown when no watcher is present

Evan You 11 лет назад
Родитель
Сommit
ffbd3eea94
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      src/directive.js

+ 3 - 1
src/directive.js

@@ -145,7 +145,9 @@ p._teardown = function () {
     if (this.unbind) {
       this.unbind()
     }
-    this._watcher.teardown()
+    if (this._watcher) {
+      this._watcher.teardown()
+    }
     this._bound = false
   }
 }