File tree 1 file changed +6
-14
lines changed
1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -414,14 +414,13 @@ function $RouteProvider(){
414
414
$q . when ( next ) .
415
415
then ( function ( ) {
416
416
if ( next ) {
417
- var keys = [ ] ,
418
- values = [ ] ,
417
+ var locals = extend ( { } , next . resolve ) ,
419
418
template ;
420
419
421
- forEach ( next . resolve || { } , function ( value , key ) {
422
- keys . push ( key ) ;
423
- values . push ( isString ( value ) ? $injector . get ( value ) : $injector . invoke ( value ) ) ;
420
+ forEach ( locals , function ( value , key ) {
421
+ locals [ key ] = isString ( value ) ? $injector . get ( value ) : $injector . invoke ( value ) ;
424
422
} ) ;
423
+
425
424
if ( isDefined ( template = next . template ) ) {
426
425
if ( isFunction ( template ) ) {
427
426
template = template ( next . params ) ;
@@ -437,16 +436,9 @@ function $RouteProvider(){
437
436
}
438
437
}
439
438
if ( isDefined ( template ) ) {
440
- keys . push ( '$template' ) ;
441
- values . push ( template ) ;
439
+ locals [ '$template' ] = template ;
442
440
}
443
- return $q . all ( values ) . then ( function ( values ) {
444
- var locals = { } ;
445
- forEach ( values , function ( value , index ) {
446
- locals [ keys [ index ] ] = value ;
447
- } ) ;
448
- return locals ;
449
- } ) ;
441
+ return $q . all ( locals ) ;
450
442
}
451
443
} ) .
452
444
// after route change
You can’t perform that action at this time.
0 commit comments