aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/compile.js
diff options
context:
space:
mode:
authorCaitlin Potter2014-01-03 11:50:53 -0500
committerCaitlin Potter2014-01-31 12:45:35 -0500
commit5ed721b9b5e95ae08450e1ae9d5202e7f3f79295 (patch)
tree51f4b0f3dcc3ed684e5f5c91edf0de2569ebedc0 /src/ng/compile.js
parentc22ab5d2e28605462ba77f6c02e99efdd24338a3 (diff)
downloadangular.js-5ed721b9b5e95ae08450e1ae9d5202e7f3f79295.tar.bz2
fix($compile): retain CSS classes added in cloneAttachFn on asynchronous directives
Previously, classes added to asynchronous directive elements during the clone attach function would not persist after the node is merged with the template, prior to linking. This change corrects this behaviour and brings it in line with synchronous directives. Closes #5439 Closes #5617
Diffstat (limited to 'src/ng/compile.js')
-rw-r--r--src/ng/compile.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ng/compile.js b/src/ng/compile.js
index 193dff7a..36c23086 100644
--- a/src/ng/compile.js
+++ b/src/ng/compile.js
@@ -1711,9 +1711,13 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
linkNode = $compileNode[0];
if (beforeTemplateLinkNode !== beforeTemplateCompileNode) {
+ var oldClasses = beforeTemplateLinkNode.className;
// it was cloned therefore we have to clone as well.
linkNode = jqLiteClone(compileNode);
replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode);
+
+ // Copy in CSS classes from original node
+ safeAddClass(jqLite(linkNode), oldClasses);
}
if (afterTemplateNodeLinkFn.transclude) {
childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude);