| 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));
|
| }
|
|
|
| /**
|
|
|