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

Unified Diff: third_party/pkg/angular/lib/core_dom/directive.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/core_dom/directive.dart
===================================================================
--- third_party/pkg/angular/lib/core_dom/directive.dart (revision 33054)
+++ third_party/pkg/angular/lib/core_dom/directive.dart (working copy)
@@ -6,6 +6,13 @@
typedef AttributeChanged(String newValue);
/**
+ * Callback function used to notify of text changes.
+ */
+abstract class TextChangeListener{
+ call(String text);
+}
+
+/**
* NodeAttrs is a facade for element attributes. The facade is responsible
* for normalizing attribute names as well as allowing access to the
* value of the directive.
@@ -18,13 +25,14 @@
NodeAttrs(this.element);
operator [](String attributeName) =>
- element.attributes[attributeName];
+ element.attributes[snakecase(attributeName, '-')];
operator []=(String attributeName, String value) {
+ var snakeName = snakecase(attributeName, '-');
if (value == null) {
- element.attributes.remove(attributeName);
+ element.attributes.remove(snakeName);
} else {
- element.attributes[attributeName] = value;
+ element.attributes[snakeName] = value;
}
if (_observers != null && _observers.containsKey(attributeName)) {
_observers[attributeName].forEach((fn) => fn(value));
@@ -48,14 +56,14 @@
}
void forEach(void f(String k, String v)) {
- element.attributes.forEach(f);
+ element.attributes.forEach((k, v) => f(camelcase(k), v));
}
bool containsKey(String attributeName) =>
- element.attributes.containsKey(attributeName);
+ element.attributes.containsKey(snakecase(attributeName, '-'));
Iterable<String> get keys =>
- element.attributes.keys;
+ element.attributes.keys.map((name) => camelcase(name));
}
/**
« no previous file with comments | « third_party/pkg/angular/lib/core_dom/compiler.dart ('k') | third_party/pkg/angular/lib/core_dom/directive_map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698