diff options
| author | Pete Bacon Darwin | 2013-02-18 12:05:16 +0000 |
|---|---|---|
| committer | Pete Bacon Darwin | 2013-02-18 12:05:16 +0000 |
| commit | 791804bdbfa6da7a39283623bd05628a01cd8720 (patch) | |
| tree | b5745caf3351cbc7723a7ab83720b02b088f851e /src/ng/directive/ngView.js | |
| parent | 7eafbb98c64c0dc079d7d3ec589f1270b7f6fea5 (diff) | |
| download | angular.js-791804bdbfa6da7a39283623bd05628a01cd8720.tar.bz2 | |
fix(compile): should not leak memory when there are top level empty text nodes
The change to prevent <span> 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
Diffstat (limited to 'src/ng/directive/ngView.js')
| -rw-r--r-- | src/ng/directive/ngView.js | 2 |
1 files changed, 1 insertions, 1 deletions
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); |
