This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat($compile): use allOrNothing interpolation for ngAttr*
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
- Loading branch information
Showing
3 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters