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

ng-attr vs attribute is different in FF #7051

Closed
jbedard opened this issue Apr 9, 2014 · 2 comments
Closed

ng-attr vs attribute is different in FF #7051

jbedard opened this issue Apr 9, 2014 · 2 comments

Comments

@jbedard
Copy link
Contributor

jbedard commented Apr 9, 2014

I have an input where I want the default size to be 1 until the ng-attr-size is calculated.

    <input size="1" ng-attr-size="{{calculatedSize}}" />

In most browsers the Element.attributes seems to be in the order that the attributes are specified in the DOM. In FF the Element.attributes order does not seem to reflect the DOM order.

ng-attr copies ng-attr-name values into the $attrs under the "name" so they will be evaluated on the first digest, but in FF the size="1" overrides the ng-attr-size so the ng-attr expression never gets evaluated.

Is this expected? Maybe an error/warning logged when an attribute overrides another would be the best solution?

Here's a simple example that is different in FF vs chrome/ie (the example uses value instead of size): http://jsfiddle.net/ZNPPH/2/

@jbedard
Copy link
Contributor Author

jbedard commented Jun 25, 2014

Closing. This was fixed with #7861

@Narretz
Copy link
Contributor

Narretz commented Jun 25, 2014

Thanks, @jbedard. The commit for 1.3.x is 8b0258d

@Narretz Narretz closed this as completed Jun 25, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants