-
Notifications
You must be signed in to change notification settings - Fork 27.5k
fix for style attribute not being copied to the dst object #4882
Conversation
Thanks.
Here is a reduced case: http://plnkr.co/edit/Haplv16k6eHh5O5PJphc?p=preview |
Tobias, you can have the credits, i don't mind ;) So it will be just quicker to put in under your name, (and also make the test case, i think you are better suited for that then me) I did sign the cla so that if there are bigger patches or contributions coming up i am ready. By the way, we are building a generic webcomponent beans and all our beans do have exactly those 4 points, so 1.2 really broke pretty much everything ;) |
Ok, created a new PR. Thanks for signing the CLA and reporting this! Sounds like you are building a UI builder. Is it open source? |
A directive with a template with `replace: true` and an interpolated style at the root element should work correctly. Closes angular#4882.
Hi, Tobias |
Changes landed in master as e1254b2, |
The editor (and later on the client) are open source: |
That's great. Is there a running demo / download? |
A directive with a template with `replace: true` and an interpolated style at the root element should work correctly. Closes angular#4882.
A directive with a template with `replace: true` and an interpolated style at the root element should work correctly. Closes angular#4882.
When we move to 1.2 we got a lot of exceptions in the console:
TypeError: Cannot read property 'length' of undefined
at $interpolate (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.js:7960:24)
at attrInterpolatePreLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.js:6354:33)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.js:6429:44
at nodeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.js:6068:13)
at compositeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.js:5509:15)
at nodeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.js:6082:24)
at compositeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.js:5521:15)
at compositeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.js:5524:13)
at publicLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.js:5421:30)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.js:1287:27
(and a lot more, exactly like that)
this is because angular expects that the attributes object has a "style" attribute by that name.
But angular doesn't copy that style tag to the dst map in the compile.js code (mergeTemplateAttributes function)
We have for example a directive called that doesn't have the "style" attribute (it just have some others)
then the template of that directive does have a "style" tag in the first dom element.
Now angular wants to merge all the attributes in each other. But for the style tag it seems to do something totally different then by other attributes (or even the class which also has a special copy)
I made a plunker to show the problem also:
http://plnkr.co/edit/OdFWJCmlPijE7LIOumAM?p=preview