| Index: third_party/pkg/angular/lib/directive/ng_src_boolean.dart
|
| ===================================================================
|
| --- third_party/pkg/angular/lib/directive/ng_src_boolean.dart (revision 33054)
|
| +++ third_party/pkg/angular/lib/directive/ng_src_boolean.dart (working copy)
|
| @@ -30,7 +30,7 @@
|
| @NgDirective(selector: '[ng-required]', map: const {'ng-required': '=>required'})
|
| @NgDirective(selector: '[ng-selected]', map: const {'ng-selected': '=>selected'})
|
| class NgBooleanAttributeDirective {
|
| - final NodeAttrs attrs;
|
| + NodeAttrs attrs;
|
| NgBooleanAttributeDirective(this.attrs);
|
|
|
| _setBooleanAttribute(name, value) => attrs[name] = (toBool(value) ? '' : null);
|
| @@ -65,7 +65,7 @@
|
| @NgDirective(selector: '[ng-src]', map: const {'ng-src': '@src'})
|
| @NgDirective(selector: '[ng-srcset]', map: const {'ng-srcset': '@srcset'})
|
| class NgSourceDirective {
|
| - final NodeAttrs attrs;
|
| + NodeAttrs attrs;
|
| NgSourceDirective(this.attrs);
|
|
|
| set href(value) => attrs['href'] = value;
|
| @@ -75,31 +75,29 @@
|
| }
|
|
|
| /**
|
| - * In SVG some attributes have a specific syntax. Placing `{{interpolation}}` in
|
| - * those attributes will break the attribute syntax, and browser will clear the
|
| - * attribute.
|
| + * In SVG some attributes have a specific syntax. Placing `{{interpolation}}` in those
|
| + * attributes will break the attribute syntax, and browser will clear the attribute.
|
| *
|
| - * The `ng-attr-*` is a generic way to use interpolation without breaking the
|
| - * attribute syntax validator. The `ng-attr-` part get stripped.
|
| + * The `ng-attr-*` is a generic way to use interpolation without breaking the attribute
|
| + * syntax validator. The `ng-attr-` part get stripped.
|
| *
|
| * @example
|
| - * <svg>
|
| - * <circle ng-attr-cx="{{cx}}"></circle>
|
| - * </svg>
|
| + <svg>
|
| + <circle ng-attr-cx="{{cx}}"></circle>
|
| + </svg>
|
| */
|
| @NgDirective(selector: '[ng-attr-*]')
|
| class NgAttributeDirective implements NgAttachAware {
|
| - final NodeAttrs _attrs;
|
| + NodeAttrs _attrs;
|
|
|
| - NgAttributeDirective(this._attrs);
|
| + NgAttributeDirective(NodeAttrs this._attrs);
|
|
|
| void attach() {
|
| - String ngAttrPrefix = 'ng-attr-';
|
| _attrs.forEach((key, value) {
|
| - if (key.startsWith(ngAttrPrefix)) {
|
| - var newKey = key.substring(ngAttrPrefix.length);
|
| + if (key.startsWith('ngAttr')) {
|
| + String newKey = snakecase(key.substring(6));
|
| _attrs[newKey] = value;
|
| - _attrs.observe(key, (newValue) => _attrs[newKey] = newValue );
|
| + _attrs.observe(snakecase(key), (newValue) => _attrs[newKey] = newValue );
|
| }
|
| });
|
| }
|
|
|