mhevery/angular.js — comment on commit 081663eb94079bff63c85234e3e6bda632bbe440
File: src/service/compiler.js line 618
By IgorMinar:

it will work:

```
@@ -258,20 +258,20 @@ function $CompileProvider($injector) {

if (templateNode === linkNode) {
attrs = templateAttrs;
- element = attrs.$element;
} else {
attrs = {};
// this is a shallow copy which replaces $element;
for(var key in templateAttrs) {
if (templateAttrs.hasOwnProperty(key)) {
if (key == '$element') {
- element = attrs.$element = jqLite(linkNode);
+ attrs.$element = jqLite(linkNode);
} else {
attrs[key] = templateAttrs[key];
}
}
}
}
+ element = attrs.$element;

// PRELINKING
for(i = 0; i < ii; i++) {
```