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

Unified Diff: third_party/pkg/angular/lib/introspection.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
« no previous file with comments | « third_party/pkg/angular/lib/filter/number.dart ('k') | third_party/pkg/angular/lib/mock/debug.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pkg/angular/lib/introspection.dart
===================================================================
--- third_party/pkg/angular/lib/introspection.dart (revision 33054)
+++ third_party/pkg/angular/lib/introspection.dart (working copy)
@@ -1,18 +1,17 @@
part of angular;
/**
- * A global write only variable which keeps track of objects attached to the
- * elements. This is useful for debugging AngularDart application from the
- * browser's REPL.
+ * A global write only variable which keeps track of objects attached to the elements.
+ * This is usefull for debugging AngularDart application from the browser's REPL.
*/
-var _elementExpando = new Expando('element');
+Expando _elementExpando = new Expando('element');
/**
* Return the closest [ElementProbe] object for a given [Element].
*
- * NOTE: This global method is here to make it easier to debug Angular
- * application from the browser's REPL, unit or end-to-end tests. The
- * function is not intended to be called from Angular application.
+ * NOTE: This global method is here to make it easier to debug Angular application from
+ * the browser's REPL, unit or end-to-end tests. The function is not intended to
+ * be called from Angular application.
*/
ElementProbe ngProbe(dom.Node node) {
while(node != null) {
@@ -27,9 +26,9 @@
/**
* Return the [Injector] associated with a current [Element].
*
- * **NOTE**: This global method is here to make it easier to debug Angular
- * application from the browser's REPL, unit or end-to-end tests. The function
- * is not intended to be called from Angular application.
+ * **NOTE**: This global method is here to make it easier to debug Angular application from
+ * the browser's REPL, unit or end-to-end tests. The function is not intended to be called
+ * from Angular application.
*/
Injector ngInjector(dom.Node node) => ngProbe(node).injector;
@@ -37,15 +36,14 @@
/**
* Return the [Scope] associated with a current [Element].
*
- * **NOTE**: This global method is here to make it easier to debug Angular
- * application from the browser's REPL, unit or end-to-end tests. The function
- * is not intended to be called from Angular application.
+ * **NOTE**: This global method is here to make it easier to debug Angular application from
+ * the browser's REPL, unit or end-to-end tests. The function is not intended to be called
+ * from Angular application.
*/
Scope ngScope(dom.Node node) => ngProbe(node).scope;
-List<dom.Element> ngQuery(dom.Node element, String selector,
- [String containsText]) {
+List<dom.Element> ngQuery(dom.Node element, String selector, [String containsText]) {
var list = [];
var children = [element];
if ((element is dom.Element) && element.shadowRoot != null) {
@@ -66,9 +64,9 @@
/**
* Return a List of directive controllers associated with a current [Element].
*
- * **NOTE**: This global method is here to make it easier to debug Angular
- * application from the browser's REPL, unit or end-to-end tests. The function
- * is not intended to be called from Angular application.
+ * **NOTE**: This global method is here to make it easier to debug Angular application from
+ * the browser's REPL, unit or end-to-end tests. The function is not intended to be called
+ * from Angular application.
*/
List<Object> ngDirectives(dom.Node node) {
ElementProbe probe = _elementExpando[node];
@@ -76,12 +74,11 @@
}
_publishToJavaScript() {
- js.context
- ..['ngProbe'] = (dom.Node node) => _jsProbe(ngProbe(node))
- ..['ngInjector'] = (dom.Node node) => _jsInjector(ngInjector(node))
- ..['ngScope'] = (dom.Node node) => _jsScope(ngScope(node))
- ..['ngQuery'] = (dom.Node node, String selector, [String containsText]) =>
- new js.JsArray.from(ngQuery(node, selector, containsText));
+ js.context['ngProbe'] = (dom.Node node) => _jsProbe(ngProbe(node));
+ js.context['ngInjector'] = (dom.Node node) => _jsInjector(ngInjector(node));
+ js.context['ngScope'] = (dom.Node node) => _jsScope(ngScope(node));
+ js.context['ngQuery'] = (dom.Node node, String selector, [String containsText]) =>
+ new js.JsArray.from(ngQuery(node, selector, containsText));
}
js.JsObject _jsProbe(ElementProbe probe) {
@@ -93,17 +90,18 @@
})..['_dart_'] = probe;
}
-js.JsObject _jsInjector(Injector injector) =>
- new js.JsObject.jsify({"get": injector.get})..['_dart_'] = injector;
+js.JsObject _jsInjector(Injector injector) {
+ return new js.JsObject.jsify({
+ "get": injector.get
+ })..['_dart_'] = injector;
+}
js.JsObject _jsScope(Scope scope) {
return new js.JsObject.jsify({
- "apply": scope.apply,
- "digest": scope.rootScope.digest,
- "flush": scope.rootScope.flush,
- "context": scope.context,
- "get": (name) => scope.context[name],
- "set": (name, value) => scope.context[name] = value
+ "\$apply": scope.$apply,
+ "\$digest": scope.$digest,
+ "get": (name) => scope[name],
+ "set": (name, value) => scope[name] = value
})..['_dart_'] = scope;
}
« no previous file with comments | « third_party/pkg/angular/lib/filter/number.dart ('k') | third_party/pkg/angular/lib/mock/debug.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698