-
Notifications
You must be signed in to change notification settings - Fork 27.4k
fix($compile): fix ng-attr vs normal attribute ordering #7739
Conversation
Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.
If you need to make changes to your pull request, you can update the commit with Thanks again for your help! |
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. |
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). |
expect(element.attr('foo')).toBe('42'); | ||
})); | ||
|
||
it('should override the attr on digest (ng-attr after)', inject(function($compile, $rootScope) { |
There was a problem hiding this comment.
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
I've removed the extra test and updated the other to also check the Attribute value at link time. |
…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
Getting ready to merge this, just wrote a bit more info in the commit message and added a few other test cases. |
…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
This ensures ng-attr always overrides normal attributes of the same name.
Fixes: #7051