Index: pkg/observe/lib/html.dart |
diff --git a/pkg/observe/lib/html.dart b/pkg/observe/lib/html.dart |
index abf333a4abba170f7954274825eb694ad1248c06..262753149136e9314ae94cb8ff9f9ddcf6f6994a 100644 |
--- a/pkg/observe/lib/html.dart |
+++ b/pkg/observe/lib/html.dart |
@@ -51,7 +51,12 @@ class ObservableLocationHash extends ChangeNotifier { |
} |
} |
-/** Add or remove CSS class [className] based on the [value]. */ |
+/** |
+ * *Deprecated* use [CssClassSet.toggle] instead. |
+ * |
+ * Add or remove CSS class [className] based on the [value]. |
+ */ |
+@deprecated |
void updateCssClass(Element element, String className, bool value) { |
if (value == true) { |
element.classes.add(className); |
@@ -60,11 +65,21 @@ void updateCssClass(Element element, String className, bool value) { |
} |
} |
-/** Bind a CSS class to the observable [object] and property [path]. */ |
+/** |
+ * *Deprecated* use `class="{{ binding }}"` in your HTML instead. It will also |
+ * work on a `<polymer-element>`. |
+ * |
+ * Bind a CSS class to the observable [object] and property [path]. |
+ */ |
+@deprecated |
PathObserver bindCssClass(Element element, String className, |
Observable object, String path) { |
- return new PathObserver(object, path)..bindSync((value) { |
+ callback(value) { |
updateCssClass(element, className, value); |
- }); |
+ } |
+ |
+ var obs = new PathObserver(object, path); |
+ callback(obs.open(callback)); |
+ return obs; |
} |