This repository was archived by the owner on Apr 12, 2024. It is now read-only.
fix for style attribute not being copied to the dst object #4882
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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