From 791804bdbfa6da7a39283623bd05628a01cd8720 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Mon, 18 Feb 2013 12:05:16 +0000 Subject: fix(compile): should not leak memory when there are top level empty text nodes The change to prevent elements being wrapped around empty text nodes caused these empty text nodes to have scopes and controllers attached, through jqLite.data() calls, which led to memory leaks and errors in IE8. Now we exclude all but document nodes and elements from having jqLite.data() set both in the compiler and in ng-view. Fixes: #1968 and #1876 --- src/ng/directive/ngView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ng/directive/ngView.js') diff --git a/src/ng/directive/ngView.js b/src/ng/directive/ngView.js index 2fd3a600..6e92c2d8 100644 --- a/src/ng/directive/ngView.js +++ b/src/ng/directive/ngView.js @@ -147,7 +147,7 @@ var ngViewDirective = ['$http', '$templateCache', '$route', '$anchorScroll', '$c if (current.controller) { locals.$scope = lastScope; controller = $controller(current.controller, locals); - element.contents().data('$ngControllerController', controller); + element.children().data('$ngControllerController', controller); } link(lastScope); -- cgit v1.2.3