@@ -40,7 +40,7 @@ import {
4040 Directive ,
4141 onDestroy
4242} from 'angular2/annotations' ;
43- import { bind , Injector , Binding , resolveBindings , Optional , Inject , Injectable , Self , Parent , Ancestor , Unbounded , self , InjectMetadata , ParentMetadata } from 'angular2/di' ;
43+ import { bind , Injector , Binding , Optional , Inject , Injectable , Self , Parent , Ancestor , Unbounded , self , InjectMetadata , ParentMetadata } from 'angular2/di' ;
4444import { AppProtoView , AppView } from 'angular2/src/core/compiler/view' ;
4545import { ViewContainerRef } from 'angular2/src/core/compiler/view_container_ref' ;
4646import { ProtoViewRef } from 'angular2/src/core/compiler/view_ref' ;
@@ -486,6 +486,21 @@ export function main() {
486486 expect ( pei . getBindingAtIndex ( 1 ) . key . token ) . toEqual ( "injectable1" ) ;
487487 } ) ;
488488
489+ it ( "should collect view and host injectables from nested arrays" , ( ) => {
490+ var pei = createPei ( null , 0 , [
491+ DirectiveBinding . createFromType (
492+ SimpleDirective ,
493+ new dirAnn . Component ( {
494+ viewInjector : [ [ [ bind ( 'view' ) . toValue ( 'view' ) ] ] ] ,
495+ hostInjector : [ [ [ bind ( 'host' ) . toValue ( 'host' ) ] ] ]
496+ } ) )
497+ ] , 0 , true ) ;
498+
499+ expect ( pei . getBindingAtIndex ( 0 ) . key . token ) . toBe ( SimpleDirective ) ;
500+ expect ( pei . getBindingAtIndex ( 1 ) . key . token ) . toEqual ( "view" ) ;
501+ expect ( pei . getBindingAtIndex ( 2 ) . key . token ) . toEqual ( "host" ) ;
502+ } ) ;
503+
489504 it ( 'should support an arbitrary number of bindings' , ( ) => {
490505 var pei = createPei ( null , 0 , dynamicBindings ) ;
491506
0 commit comments