This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.5k
angular blows away dynamically added classes when compiling directives that compile child directives that use the templateUrl property. #5439
Comments
ghost
assigned vojtajina
Dec 20, 2013
ghost
assigned caitp
Dec 30, 2013
So, there are some interesting things about this:
... On further inspection: if (beforeTemplateLinkNode !== beforeTemplateCompileNode) {
// it was cloned therefore we have to clone as well.
linkNode = jqLiteClone(compileNode);
replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode);
} in |
caitp
added a commit
to caitp/angular.js
that referenced
this issue
Jan 3, 2014
In synchronous directives (without a templateUrl), classes added to the node during the clone attach function persist in the post-link function. Before this patch, classes addedd to asynchronous templates during the clone attach function would not persist after the node is replaced with the template prior to linking. Fixes angular#5439
caitp
added a commit
to caitp/angular.js
that referenced
this issue
Jan 3, 2014
In synchronous directives (without a templateUrl), classes added to the node during the clone attach function persist in the post-link function. Before this patch, classes addedd to asynchronous templates during the clone attach function would not persist after the node is replaced with the template prior to linking. Fixes angular#5439
caitp
added a commit
to caitp/angular.js
that referenced
this issue
Jan 3, 2014
In synchronous directives (without a templateUrl), classes added to the node during the clone attach function persist in the post-link function. Before this patch, classes addedd to asynchronous templates during the clone attach function would not persist after the node is replaced with the template prior to linking. Fixes angular#5439
caitp
added a commit
to caitp/angular.js
that referenced
this issue
Jan 3, 2014
…ective In synchronous directives (without a templateUrl), classes added to the node during the clone attach function persist in the post-link function. Before this patch, classes addedd to asynchronous templates during the clone attach function would not persist after the node is replaced with the template prior to linking. Fixes angular#5439
caitp
added a commit
to caitp/angular.js
that referenced
this issue
Jan 3, 2014
In synchronous directives (without a templateUrl), classes added to the node during the clone attach function persist in the post-link function. Before this patch, classes addedd to asynchronous templates during the clone attach function would not persist after the node is replaced with the template prior to linking. Fixes angular#5439
caitp
added a commit
to caitp/angular.js
that referenced
this issue
Jan 31, 2014
In synchronous directives (without a templateUrl), classes added to the node during the clone attach function persist in the post-link function. Before this patch, classes addedd to asynchronous templates during the clone attach function would not persist after the node is replaced with the template prior to linking. Fixes angular#5439
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
http://plnkr.co/edit/EQlLcqdLfskU9pMox4uF?p=preview
In this example, I have a multi-form-renderer directive which renders a collection of magical-input directives. The multi-form-renderer directive is dynamically adding a class of 'ducktales' with jQuery on the magical-input's container.
If I use templateUrl (as you can see, I am currently using magical_input.html which is set in the templateCache inside the main script.js file), then angular blows away the ducktales class.
If I change the magicalInput directive to use template: '', instead of templateUrl: 'magical_input.html', then the 'ducktales' class is there as it should be.
This bug caused a great deal of frustration and took forever to track down. Thank you.
The text was updated successfully, but these errors were encountered: