mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-01 12:33:37 +08:00
allOrNothing interpolation is now used for ng-attr-*, under all circumstances. This prevents
uninitialized attributes from being added to the DOM with invalid values which cause errors
to be shown.
BREAKING CHANGE:
Now, ng-attr-* will never add the attribute to the DOM if any of the interpolated expressions
evaluate to `undefined`.
To work around this, initialize values which are intended to be the empty string with the
empty string:
For example, given the following markup:
<div ng-attr-style="border-radius: {{value}}{{units}}"></div>
If $scope.value is `4`, and $scope.units is undefined, the resulting markup is unchanged:
<div ng-attr-style="border-radius: {{value}}{{units}}"></div>
However, if $scope.units is `""`, then the resulting markup is updated:
<div ng-attr-style="border-radius: {{value}}{{units}}" style="border-radius: 4"></div>
Closes #8376
Closes #8399