Ver Fonte

fix directive teardown when no watcher is present

Evan You há 11 anos atrás
pai
commit
ffbd3eea94
1 ficheiros alterados com 3 adições e 1 exclusões
  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
   }
 }