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

fix($compile): fix ng-attr vs normal attribute ordering #7739

Closed
wants to merge 1 commit into from

Conversation

jbedard
Copy link
Contributor

@jbedard jbedard commented Jun 7, 2014

This ensures ng-attr always overrides normal attributes of the same name.

Fixes: #7051

@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 (#7739)

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!

Sorry, something went wrong.

@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.

@jbedard jbedard added cla: no and removed cla: yes labels Jun 7, 2014
@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).

@jbedard jbedard added cla: yes and removed cla: no labels Jun 7, 2014
expect(element.attr('foo')).toBe('42');
}));

it('should override the attr on digest (ng-attr after)', inject(function($compile, $rootScope) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this second test doesn't fail, and is probably redundant

@caitp caitp added this to the 1.3.0-beta.12 milestone Jun 8, 2014
@jbedard
Copy link
Contributor Author

jbedard commented Jun 8, 2014

I've removed the extra test and updated the other to also check the Attribute value at link time.

@caitp caitp self-assigned this Jun 16, 2014
caitp pushed a commit to caitp/angular.js that referenced this pull request Jun 16, 2014
…tr-*

Previously, <element ng-attr-foo="{{binding}}" foo="bar"></element>'s "foo" attribute would always
equal "bar", because the bound version was overwritten. This CL corrects this behaviour and ensures
that the ordering of attributes does not have an effect on whether or not ng-attr-bound attributes
do their work.

Closes angular#7739
@caitp
Copy link
Contributor

caitp commented Jun 16, 2014

Getting ready to merge this, just wrote a bit more info in the commit message and added a few other test cases.

@caitp caitp closed this in 8b0258d Jun 16, 2014
caitp pushed a commit to caitp/angular.js that referenced this pull request Jun 16, 2014
…tr-*

Previously, <element ng-attr-foo="{{binding}}" foo="bar"></element>'s "foo" attribute would always
equal "bar", because the bound version was overwritten. This CL corrects this behaviour and ensures
that the ordering of attributes does not have an effect on whether or not ng-attr-bound attributes
do their work.

Closes angular#7739
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.

ng-attr vs attribute is different in FF
4 participants