diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ng/directive/booleanAttrs.js | 29 | 
1 files changed, 27 insertions, 2 deletions
| diff --git a/src/ng/directive/booleanAttrs.js b/src/ng/directive/booleanAttrs.js index 7e0e3a42..8f7399a6 100644 --- a/src/ng/directive/booleanAttrs.js +++ b/src/ng/directive/booleanAttrs.js @@ -107,6 +107,31 @@  /**   * @ngdoc directive + * @name ng.directive:ngSrcset + * @restrict A + * + * @description + * Using Angular markup like `{{hash}}` in a `srcset` attribute doesn't + * work right: The browser will fetch from the URL with the literal + * text `{{hash}}` until Angular replaces the expression inside + * `{{hash}}`. The `ngSrcset` directive solves this problem. + * + * The buggy way to write it: + * <pre> + * <img srcset="http://www.gravatar.com/avatar/{{hash}} 2x"/> + * </pre> + * + * The correct way to write it: + * <pre> + * <img ng-srcset="http://www.gravatar.com/avatar/{{hash}} 2x"/> + * </pre> + * + * @element IMG + * @param {template} ngSrcset any string which can contain `{{}}` markup. + */ + +/** + * @ngdoc directive   * @name ng.directive:ngDisabled   * @restrict A   * @@ -325,8 +350,8 @@ forEach(BOOLEAN_ATTR, function(propName, attrName) {  }); -// ng-src, ng-href are interpolated -forEach(['src', 'href'], function(attrName) { +// ng-src, ng-srcset, ng-href are interpolated +forEach(['src', 'srcset', 'href'], function(attrName) {    var normalized = directiveNormalize('ng-' + attrName);    ngAttributeAliasDirectives[normalized] = function() {      return { | 
