This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -601,15 +601,8 @@ function $RouteProvider() {
601
601
$q . when ( nextRoute ) .
602
602
then ( function ( ) {
603
603
if ( nextRoute ) {
604
- var locals = angular . extend ( { } , nextRoute . resolve ) ,
605
- template , templateUrl ;
606
-
607
- angular . forEach ( locals , function ( value , key ) {
608
- locals [ key ] = angular . isString ( value ) ?
609
- $injector . get ( value ) : $injector . invoke ( value , null , null , key ) ;
610
- } ) ;
611
-
612
- template = getTemplateFor ( nextRoute ) ;
604
+ var locals = resolveLocalsFor ( nextRoute ) ;
605
+ var template = getTemplateFor ( nextRoute ) ;
613
606
if ( angular . isDefined ( template ) ) {
614
607
locals [ '$template' ] = template ;
615
608
}
@@ -633,6 +626,16 @@ function $RouteProvider() {
633
626
}
634
627
}
635
628
629
+ function resolveLocalsFor ( route ) {
630
+ var locals = angular . extend ( { } , route . resolve ) ;
631
+ angular . forEach ( locals , function ( value , key ) {
632
+ locals [ key ] = angular . isString ( value ) ?
633
+ $injector . get ( value ) :
634
+ $injector . invoke ( value , null , null , key ) ;
635
+ } ) ;
636
+ return locals ;
637
+ }
638
+
636
639
637
640
function getTemplateFor ( route ) {
638
641
var template , templateUrl ;
You can’t perform that action at this time.
0 commit comments