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

Side by Side Diff: third_party/pkg/angular/lib/mock/probe.dart

Issue 256553002: Revert "Update all Angular libs (run update_all.sh)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 part of angular.mock; 1 part of angular.mock;
2 2
3 /* 3 /*
4 * Use Probe directive to capture the Scope, Injector and Element from any DOM 4 * Use Probe directive to capture the Scope, Injector and Element from any DOM
5 * location into root-scope. This is useful for testing to get a hold of 5 * location into root-scope. This is useful for testing to get a hold of
6 * any directive. 6 * any directive.
7 * 7 *
8 * <div some-directive probe="myProbe">..</div> 8 * <div some-directive probe="myProbe">..</div>
9 * 9 *
10 * rootScope.myProbe.directive(SomeAttrDirective); 10 * rootScope.myProbe.directive(SomeAttrDirective);
11 */ 11 */
12 @Decorator(selector: '[probe]') 12 @NgDirective(selector: '[probe]')
13 class Probe implements DetachAware { 13 class Probe implements NgDetachAware {
14 final Scope scope; 14 final Scope scope;
15 final Injector injector; 15 final Injector injector;
16 final Element element; 16 final Element element;
17 String _probeName; 17 final NodeAttrs _attrs;
18 18
19 Probe(this.scope, this.injector, this.element) { 19 Probe(this.scope, this.injector, this.element, this._attrs) {
20 _probeName = element.attributes['probe']; 20 scope.rootScope.context[_attrs['probe']] = this;
21 scope.rootScope.context[_probeName] = this;
22 } 21 }
23 22
24 void detach() { 23 void detach() {
25 scope.rootScope.context[_probeName] = null; 24 scope.rootScope.context[_attrs['probe']] = null;
26 } 25 }
27 26
28 /** 27 /**
29 * Retrieve a Directive at the current element. 28 * Retrieve a Directive at the current element.
30 */ 29 */
31 directive(Type type) => injector.get(type); 30 directive(Type type) => injector.get(type);
32 } 31 }
33 32
OLDNEW
« no previous file with comments | « third_party/pkg/angular/lib/mock/module.dart ('k') | third_party/pkg/angular/lib/mock/test_bed.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698