aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jqLite.js2
-rw-r--r--src/ng/compile.js18
2 files changed, 7 insertions, 13 deletions
diff --git a/src/jqLite.js b/src/jqLite.js
index efe3ec31..02291932 100644
--- a/src/jqLite.js
+++ b/src/jqLite.js
@@ -75,7 +75,7 @@
*/
var jqCache = {},
- jqName = 'ng-' + new Date().getTime(),
+ jqName = JQLite.expando = 'ng-' + new Date().getTime(),
jqId = 1,
addEventListenerFn = (window.document.addEventListener
? function(element, type, fn) {element.addEventListener(type, fn, false);}
diff --git a/src/ng/compile.js b/src/ng/compile.js
index 5db7b671..00628365 100644
--- a/src/ng/compile.js
+++ b/src/ng/compile.js
@@ -867,22 +867,12 @@ function $CompileProvider($provide) {
linkRootElement = linkQueue.pop(),
origLinkNode = linkQueue.pop(),
scope = linkQueue.pop(),
- linkNode = compileNode,
- $origLinkNode = jqLite(origLinkNode);
+ linkNode = compileNode;
if (origLinkNode !== origCompileNode) {
// it was cloned therefore we have to clone as well.
linkNode = JQLiteClone(compileNode);
- replaceWith(linkRootElement, $origLinkNode, linkNode);
- }
-
- if (replace) {
- if ($origLinkNode.data('$scope')) {
- // if the original element before replacement had a new scope, the replacement should
- // get it as well
- jqLite(linkNode).data('$scope', scope);
- }
- dealoc($origLinkNode);
+ replaceWith(linkRootElement, jqLite(origLinkNode), linkNode);
}
afterTemplateNodeLinkFn(function() {
@@ -992,12 +982,16 @@ function $CompileProvider($provide) {
for(i = 0, ii = $rootElement.length; i < ii; i++) {
if ($rootElement[i] == oldNode) {
$rootElement[i] = newNode;
+ break;
}
}
}
+
if (parent) {
parent.replaceChild(newNode, oldNode);
}
+
+ newNode[jqLite.expando] = oldNode[jqLite.expando];
$element[0] = newNode;
}
}];