aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng
diff options
context:
space:
mode:
Diffstat (limited to 'src/ng')
-rw-r--r--src/ng/compile.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ng/compile.js b/src/ng/compile.js
index e1aba35b..1dbb63be 100644
--- a/src/ng/compile.js
+++ b/src/ng/compile.js
@@ -865,6 +865,7 @@ function $CompileProvider($provide) {
var srcAttr = src.$attr,
dstAttr = dst.$attr,
$element = dst.$$element;
+
// reapply the old attributes to the new element
forEach(dst, function(value, key) {
if (key.charAt(0) != '$') {
@@ -874,10 +875,12 @@ function $CompileProvider($provide) {
dst.$set(key, value, true, srcAttr[key]);
}
});
+
// copy the new attributes on the old attrs object
forEach(src, function(value, key) {
if (key == 'class') {
safeAddClass($element, value);
+ dst['class'] = (dst['class'] ? dst['class'] + ' ' : '') + value;
} else if (key == 'style') {
$element.attr('style', $element.attr('style') + ';' + value);
} else if (key.charAt(0) != '$' && !dst.hasOwnProperty(key)) {