aboutsummaryrefslogtreecommitdiffstats
path: root/test/testabilityPatch.js
diff options
context:
space:
mode:
authorMisko Hevery2011-11-22 21:28:39 -0800
committerMisko Hevery2012-01-25 11:50:37 -0800
commit9ee2cdff44e7d496774b340de816344126c457b3 (patch)
tree476ffcb4425e7160865029d6b57d41b766750285 /test/testabilityPatch.js
parent8af4fde18246ac1587b471a549e70d5d858bf0ee (diff)
downloadangular.js-9ee2cdff44e7d496774b340de816344126c457b3.tar.bz2
refactor(directives): connect new compiler
- turn everything into a directive
Diffstat (limited to 'test/testabilityPatch.js')
-rw-r--r--test/testabilityPatch.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js
index 85c844cb..1b4f11ba 100644
--- a/test/testabilityPatch.js
+++ b/test/testabilityPatch.js
@@ -61,9 +61,19 @@ afterEach(function() {
function dealoc(obj) {
if (obj) {
- var element = obj.$element || obj || {};
- if (element.nodeName) element = jqLite(element);
- if (element.dealoc) element.dealoc();
+ if (isElement(obj)) {
+ var element = obj;
+ if (element.nodeName) element = jqLite(element);
+ if (element.dealoc) element.dealoc();
+ } else {
+ for(var key in jqCache) {
+ var value = jqCache[key];
+ if (value.$scope == obj) {
+ delete jqCache[key];
+ }
+ }
+ }
+
}
}