Forráskód Böngészése

fix directive teardown when no watcher is present

Evan You 11 éve
szülő
commit
ffbd3eea94
1 módosított fájl, 3 hozzáadás és 1 törlés
  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
   }
 }