diff options
| author | Igor Minar | 2013-07-02 17:15:24 -0700 |
|---|---|---|
| committer | Igor Minar | 2013-07-02 22:35:39 -0700 |
| commit | cbbe3bfe91526af0523c0b014895f78df6a983ed (patch) | |
| tree | a33cd947d07151378f11b5d167b2a6162ca0d8fd /src/ng/compile.js | |
| parent | 91e139e52a0a9d2d47337c46c8bd9e04e7466358 (diff) | |
| download | angular.js-cbbe3bfe91526af0523c0b014895f78df6a983ed.tar.bz2 | |
revert: fix(compiler): corrects component transclusion on ...
This reverts commit 15e1a29cd08993b599f390e83a249ec17f753972.
The original commit was fixing two issues - one of them was
preventing attributes that triggered directives that replaced
the compiled node to be merged into the new node.
This change was a breaking change (as seen in the diff of the
tests in this commit) and that's why it's being removed.
A proper fix will follow.
Diffstat (limited to 'src/ng/compile.js')
| -rw-r--r-- | src/ng/compile.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/ng/compile.js b/src/ng/compile.js index 36043a15..4f5dc171 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -749,7 +749,7 @@ function $CompileProvider($provide) { newTemplateAttrs ) ); - mergeTemplateAttributes(templateAttrs, newTemplateAttrs, directive.name); + mergeTemplateAttributes(templateAttrs, newTemplateAttrs); ii = directives.length; } else { @@ -1007,16 +1007,15 @@ function $CompileProvider($provide) { * * @param {object} dst destination attributes (original DOM) * @param {object} src source attributes (from the directive template) - * @param {string} ignoreName attribute which should be ignored */ - function mergeTemplateAttributes(dst, src, ignoreName) { + function mergeTemplateAttributes(dst, src) { 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) != '$' && key != ignoreName) { + if (key.charAt(0) != '$') { if (src[key]) { value += (key === 'style' ? ';' : ' ') + src[key]; } @@ -1031,7 +1030,7 @@ function $CompileProvider($provide) { 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) && key != ignoreName) { + } else if (key.charAt(0) != '$' && !dst.hasOwnProperty(key)) { dst[key] = value; dstAttr[key] = srcAttr[key]; } @@ -1074,7 +1073,7 @@ function $CompileProvider($provide) { tempTemplateAttrs = {$attr: {}}; replaceWith($rootElement, $compileNode, compileNode); collectDirectives(compileNode, directives, tempTemplateAttrs); - mergeTemplateAttributes(tAttrs, tempTemplateAttrs, origAsyncDirective.name); + mergeTemplateAttributes(tAttrs, tempTemplateAttrs); } else { compileNode = beforeTemplateCompileNode; $compileNode.html(content); |
