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

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

Issue 176943008: Update the Angular/DI tests to latest from github. (Closed) Base URL: https://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
diff --git a/third_party/pkg/angular/lib/directive/ng_src_boolean.dart b/third_party/pkg/angular/lib/directive/ng_src_boolean.dart
index 5511c91d955813453dd17d19571787627a6d8492..f2d57ead6a303c3381561ec1a615fd734ae5128e 100644
--- a/third_party/pkg/angular/lib/directive/ng_src_boolean.dart
+++ b/third_party/pkg/angular/lib/directive/ng_src_boolean.dart
@@ -30,7 +30,7 @@ part of angular.directive;
@NgDirective(selector: '[ng-required]', map: const {'ng-required': '=>required'})
@NgDirective(selector: '[ng-selected]', map: const {'ng-selected': '=>selected'})
class NgBooleanAttributeDirective {
- NodeAttrs attrs;
+ final NodeAttrs attrs;
NgBooleanAttributeDirective(this.attrs);
_setBooleanAttribute(name, value) => attrs[name] = (toBool(value) ? '' : null);
@@ -65,7 +65,7 @@ class NgBooleanAttributeDirective {
@NgDirective(selector: '[ng-src]', map: const {'ng-src': '@src'})
@NgDirective(selector: '[ng-srcset]', map: const {'ng-srcset': '@srcset'})
class NgSourceDirective {
- NodeAttrs attrs;
+ final NodeAttrs attrs;
NgSourceDirective(this.attrs);
set href(value) => attrs['href'] = value;
@@ -75,29 +75,31 @@ class NgSourceDirective {
}
/**
- * 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 {
- NodeAttrs _attrs;
+ final NodeAttrs _attrs;
- NgAttributeDirective(NodeAttrs this._attrs);
+ NgAttributeDirective(this._attrs);
void attach() {
+ String ngAttrPrefix = 'ng-attr-';
_attrs.forEach((key, value) {
- if (key.startsWith('ngAttr')) {
- String newKey = snakecase(key.substring(6));
+ if (key.startsWith(ngAttrPrefix)) {
+ var newKey = key.substring(ngAttrPrefix.length);
_attrs[newKey] = value;
- _attrs.observe(snakecase(key), (newValue) => _attrs[newKey] = newValue );
+ _attrs.observe(key, (newValue) => _attrs[newKey] = newValue );
}
});
}

Powered by Google App Engine
This is Rietveld 408576698