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

Unified Diff: pkg/template_binding/test/custom_element_bindings_test.dart

Issue 42433002: port Node.bind to bd0a0591920da9091b326627a46a104a92c7efe7 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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: pkg/template_binding/test/custom_element_bindings_test.dart
diff --git a/pkg/template_binding/test/custom_element_bindings_test.dart b/pkg/template_binding/test/custom_element_bindings_test.dart
index 17793612392932b066f1988bcc9087ab652e2a33..c9556d5a78874c47dbe236b5abde5668663ea153 100644
--- a/pkg/template_binding/test/custom_element_bindings_test.dart
+++ b/pkg/template_binding/test/custom_element_bindings_test.dart
@@ -165,18 +165,20 @@ class MyCustomElement extends HtmlElement implements NodeBindExtension {
MyCustomElement.created() : super.created();
- NodeBinding createBinding(String name, model, String path) {
+ NodeBinding bind(String name, model, [String path]) {
switch (name) {
case 'my-point':
case 'scary-monster':
- return new _MyCustomBinding(this, name, model, path);
+ attributes.remove(name);
+ unbind(name);
+ return bindings[name] = new _MyCustomBinding(this, name, model, path);
}
- return nodeBindFallback(this).createBinding(name, model, path);
+ return nodeBindFallback(this).bind(name, model, path);
}
- bind(name, model, path) => nodeBindFallback(this).bind(name, model, path);
unbind(name) => nodeBindFallback(this).unbind(name);
unbindAll() => nodeBindFallback(this).unbindAll();
+ get bindings => nodeBindFallback(this).bindings;
}
class _MyCustomBinding extends NodeBinding {
@@ -188,7 +190,7 @@ class _MyCustomBinding extends NodeBinding {
MyCustomElement get node => super.node;
- void boundValueChanged(newValue) {
+ void valueChanged(newValue) {
if (property == 'my-point') node.myPoint = newValue;
if (property == 'scary-monster') node.scaryMonster = newValue;
}

Powered by Google App Engine
This is Rietveld 408576698