Pārlūkot izejas kodu

fix directive teardown when no watcher is present

Evan You 11 gadi atpakaļ
vecāks
revīzija
ffbd3eea94
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  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
   }
 }