angular/angular.js — pull request #4882 by jcompagner (2013-11-11 13:59:34+00:00)
Title: fix for style attribute not being copied to the dst object

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