@@ -100,6 +100,22 @@ export function main() {
100100 } ) ) ;
101101
102102
103+ it ( 'should work in an app with async components defined with "loader"' ,
104+ inject ( [ AsyncTestCompleter ] , ( async ) => {
105+ bootstrap ( ConciseAsyncAppCmp ,
106+ [ bind ( ROUTER_PRIMARY_COMPONENT ) . toValue ( AsyncAppCmp ) , testBindings ] )
107+ . then ( ( applicationRef ) => {
108+ var router = applicationRef . hostComponent . router ;
109+ router . subscribe ( ( _ ) => {
110+ expect ( el ) . toHaveText ( 'root { hello }' ) ;
111+ expect ( applicationRef . hostComponent . location . path ( ) ) . toEqual ( '/hello' ) ;
112+ async . done ( ) ;
113+ } ) ;
114+ router . navigateByUrl ( '/hello' ) ;
115+ } ) ;
116+ } ) ) ;
117+
118+
103119 it ( 'should work in an app with a constructor component' ,
104120 inject ( [ AsyncTestCompleter ] , ( async ) => {
105121 bootstrap (
@@ -187,6 +203,15 @@ class AsyncAppCmp {
187203 constructor ( public router : Router , public location : LocationStrategy ) { }
188204}
189205
206+ @Component ( { selector : 'app-cmp' } )
207+ @View ( { template : `root { <router-outlet></router-outlet> }` , directives : ROUTER_DIRECTIVES } )
208+ @RouteConfig ( [
209+ { path : '/hello' , loader : HelloLoader } ,
210+ ] )
211+ class ConciseAsyncAppCmp {
212+ constructor ( public router : Router , public location : LocationStrategy ) { }
213+ }
214+
190215@Component ( { selector : 'app-cmp' } )
191216@View ( { template : `root { <router-outlet></router-outlet> }` , directives : ROUTER_DIRECTIVES } )
192217@RouteConfig ( [
0 commit comments