Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix($compile): fix duplicate style attributes #6242

Closed
wants to merge 1 commit into from
Closed

fix($compile): fix duplicate style attributes #6242

wants to merge 1 commit into from

Conversation

vrutberg
Copy link

This fix avoids duplicating style attributes in directives that specify
'replace: true' and 'template: <div style="..." />'.

Closes #6239

@mary-poppins
Copy link

Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.

  • Uses the issue template (#6242)

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@vrutberg
Copy link
Author

@lgalfaso Alright, I will have more time to look into this later this week.

@mary-poppins
Copy link

I'm sorry, but I wasn't able to verify your Contributor License Agreement (CLA) signature. CLA signature is required for any code contributions to AngularJS.

Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match.

If you signed the CLA as a corporation, please let us know the company's name.

Thanks a bunch!

PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR.
PS2: If you are a Googler, please sign the CLA as well to simplify the CLA verification process.

@btford btford self-assigned this Jun 10, 2014
@btford btford added this to the Backlog milestone Jun 10, 2014
function($compile, $rootScope) {
element = $compile('<div replace-with-non-interpolated-style></div>')($rootScope);
$rootScope.$digest();
expect(element.attr('style')).toMatch(/^color\: red;?$/ig);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this test fail without the change to the compiler? it doesn't look like it should

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I answered my own question, okay.

@caitp
Copy link
Contributor

caitp commented Jun 10, 2014

well it generally looks okay to me, although it's not clear to me why we don't do something fancier like merge the CSSStyleDeclarations instead --- except I guess that would't work for interpolation

@mary-poppins
Copy link

CLA signature verified! Thank you!

Someone from the team will now triage your PR and it will be processed based on the determined priority (doc updates and fixes with tests are prioritized over other changes).

@Narretz
Copy link
Contributor

Narretz commented Apr 21, 2017

This type of duplication has been fixed - can't say exactly when, but at least since 1.5.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicated style attribute in directive with template and replace: true
6 participants