Skip to content

Commit cd21df3

Browse files
committed
refactor(element_injector): renamed Query.directive into Query.selector
1 parent c7e4835 commit cd21df3

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

modules/angular2/src/core/annotations_impl/di.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {CONST, stringify, isPresent} from 'angular2/src/facade/lang';
1+
import {CONST, Type, stringify, isPresent} from 'angular2/src/facade/lang';
22
import {DependencyAnnotation} from 'angular2/src/di/annotations_impl';
33
import {resolveForwardRef} from 'angular2/di';
44

@@ -55,12 +55,12 @@ export class Attribute extends DependencyAnnotation {
5555
@CONST()
5656
export class Query extends DependencyAnnotation {
5757
descendants: boolean;
58-
constructor(private _directive: any, {descendants = false}: {descendants?: boolean} = {}) {
58+
constructor(private _selector:Type, {descendants = false}: {descendants?: boolean} = {}) {
5959
super();
6060
this.descendants = descendants;
6161
}
6262

63-
get directive() { return resolveForwardRef(this._directive); }
63+
get selector() { return resolveForwardRef(this._selector); }
6464

65-
toString() { return `@Query(${stringify(this.directive)})`; }
65+
toString() { return `@Query(${stringify(this.selector)})`; }
6666
}

modules/angular2/src/core/compiler/element_injector.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -897,13 +897,13 @@ export class ElementInjector extends TreeNode<ElementInjector> {
897897
}
898898

899899
private _addToQueries(obj, token): void {
900-
if (isPresent(this._query0) && (this._query0.query.directive === token)) {
900+
if (isPresent(this._query0) && (this._query0.query.selector === token)) {
901901
this._query0.list.add(obj);
902902
}
903-
if (isPresent(this._query1) && (this._query1.query.directive === token)) {
903+
if (isPresent(this._query1) && (this._query1.query.selector === token)) {
904904
this._query1.list.add(obj);
905905
}
906-
if (isPresent(this._query2) && (this._query2.query.directive === token)) {
906+
if (isPresent(this._query2) && (this._query2.query.selector === token)) {
907907
this._query2.list.add(obj);
908908
}
909909
}
@@ -1454,8 +1454,8 @@ class QueryRef {
14541454

14551455
visit(inj: ElementInjector, aggregator: any[]): void {
14561456
if (isBlank(inj) || !inj._hasQuery(this)) return;
1457-
if (inj.hasDirective(this.query.directive)) {
1458-
aggregator.push(inj.get(this.query.directive));
1457+
if (inj.hasDirective(this.query.selector)) {
1458+
aggregator.push(inj.get(this.query.selector));
14591459
}
14601460
var child = inj._head;
14611461
while (isPresent(child)) {

0 commit comments

Comments
 (0)