File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
modules/angular2/src/core Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1- import { CONST , stringify , isPresent } from 'angular2/src/facade/lang' ;
1+ import { CONST , Type , stringify , isPresent } from 'angular2/src/facade/lang' ;
22import { DependencyAnnotation } from 'angular2/src/di/annotations_impl' ;
33import { resolveForwardRef } from 'angular2/di' ;
44
@@ -55,12 +55,12 @@ export class Attribute extends DependencyAnnotation {
5555@CONST ( )
5656export 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}
Original file line number Diff line number Diff 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 ) ) {
You can’t perform that action at this time.
0 commit comments