diff --git a/modules/angular2/src/core/annotations_impl/di.ts b/modules/angular2/src/core/annotations_impl/di.ts index 8c974ddec9..e10be1c748 100644 --- a/modules/angular2/src/core/annotations_impl/di.ts +++ b/modules/angular2/src/core/annotations_impl/di.ts @@ -1,4 +1,4 @@ -import {CONST, stringify, isPresent} from 'angular2/src/facade/lang'; +import {CONST, Type, stringify, isPresent} from 'angular2/src/facade/lang'; import {DependencyAnnotation} from 'angular2/src/di/annotations_impl'; import {resolveForwardRef} from 'angular2/di'; @@ -55,12 +55,12 @@ export class Attribute extends DependencyAnnotation { @CONST() export class Query extends DependencyAnnotation { descendants: boolean; - constructor(private _directive: any, {descendants = false}: {descendants?: boolean} = {}) { + constructor(private _selector:Type, {descendants = false}: {descendants?: boolean} = {}) { super(); this.descendants = descendants; } - get directive() { return resolveForwardRef(this._directive); } + get selector() { return resolveForwardRef(this._selector); } - toString() { return `@Query(${stringify(this.directive)})`; } + toString() { return `@Query(${stringify(this.selector)})`; } } diff --git a/modules/angular2/src/core/compiler/element_injector.ts b/modules/angular2/src/core/compiler/element_injector.ts index 3881fb8206..85117ff4c3 100644 --- a/modules/angular2/src/core/compiler/element_injector.ts +++ b/modules/angular2/src/core/compiler/element_injector.ts @@ -897,13 +897,13 @@ export class ElementInjector extends TreeNode { } private _addToQueries(obj, token): void { - if (isPresent(this._query0) && (this._query0.query.directive === token)) { + if (isPresent(this._query0) && (this._query0.query.selector === token)) { this._query0.list.add(obj); } - if (isPresent(this._query1) && (this._query1.query.directive === token)) { + if (isPresent(this._query1) && (this._query1.query.selector === token)) { this._query1.list.add(obj); } - if (isPresent(this._query2) && (this._query2.query.directive === token)) { + if (isPresent(this._query2) && (this._query2.query.selector === token)) { this._query2.list.add(obj); } } @@ -1454,8 +1454,8 @@ class QueryRef { visit(inj: ElementInjector, aggregator: any[]): void { if (isBlank(inj) || !inj._hasQuery(this)) return; - if (inj.hasDirective(this.query.directive)) { - aggregator.push(inj.get(this.query.directive)); + if (inj.hasDirective(this.query.selector)) { + aggregator.push(inj.get(this.query.selector)); } var child = inj._head; while (isPresent(child)) {