| 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;
|
| }
|
|
|
|
|