This repository was archived by the owner on Apr 12, 2024. It is now read-only.
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
Description
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/