Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: third_party/pkg/angular/lib/directive/ng_src_boolean.dart

Issue 180843004: Revert revision 33053 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 );
}
});
}
« no previous file with comments | « third_party/pkg/angular/lib/directive/ng_show_hide.dart ('k') | third_party/pkg/angular/lib/directive/ng_style.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698