diff options
| author | Luis Ramón López | 2013-02-26 00:00:47 +0100 |
|---|---|---|
| committer | Igor Minar | 2013-02-27 00:55:40 -0800 |
| commit | cf17c6af475eace31cf52944afd8e10d3afcf6c0 (patch) | |
| tree | aa552c9f6b8af0ff0ed208ec6c3a5574432a4109 /src/ngResource/resource.js | |
| parent | 86d191ed4aea9015adc71b852223475c5c762c34 (diff) | |
| download | angular.js-cf17c6af475eace31cf52944afd8e10d3afcf6c0.tar.bz2 | |
feat($compile): add attribute binding support via ngAttr*
Sometimes is not desirable to use interpolation on attributes because
the user agent parses them before the interpolation takes place. I.e:
<svg>
<circle cx="{{cx}}" cy="{{cy}}" r="{{r}}"></circle>
</svg>
The snippet throws three browser errors, one for each attribute.
For some attributes, AngularJS fixes that behaviour introducing special
directives like ng-href or ng-src.
This commit is a more general solution that allows prefixing any
attribute with "ng-attr-", "ng:attr:" or "ng_attr_" so it will
be set only when the binding is done. The prefix is then removed.
Example usage:
<svg>
<circle ng-attr-cx="{{cx}}" ng-attr-cy="{{cy}}" ng:attr-r="{{r}}"></circle>
</svg>
Closes #1050
Closes #1925
Diffstat (limited to 'src/ngResource/resource.js')
0 files changed, 0 insertions, 0 deletions
