aboutsummaryrefslogtreecommitdiffstats
path: root/src/service/compiler.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/service/compiler.js')
-rw-r--r--src/service/compiler.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/service/compiler.js b/src/service/compiler.js
index 4ac01a7c..85566f3c 100644
--- a/src/service/compiler.js
+++ b/src/service/compiler.js
@@ -729,6 +729,9 @@ function $CompileProvider($provide) {
// reapply the old attributes to the new element
forEach(dst, function(value, key) {
if (key.charAt(0) != '$') {
+ if (src[key]) {
+ value += (key === 'style' ? ';' : ' ') + src[key];
+ }
dst.$set(key, value, srcAttr[key]);
}
});
@@ -873,6 +876,12 @@ function $CompileProvider($provide) {
compile: function(element, attr) {
if (interpolateFn) {
return function(scope, element, attr) {
+ if (name === 'class') {
+ // we need to interpolate classes again, in the case the element was replaced
+ // and therefore the two class attrs got merged - we want to interpolate the result
+ interpolateFn = $interpolate(attr[name], true);
+ }
+
// we define observers array only for interpolated attrs
// and ignore observers for non interpolated attrs to save some memory
attr.$observers[name] = [];