@@ -519,6 +519,7 @@ ViewDirectiveFill.$inject = [
519519 $injectTokens . _compile ,
520520 $injectTokens . _controller ,
521521 $injectTokens . _transitions ,
522+ $injectTokens . _injector ,
522523] ;
523524
524525/**
@@ -528,6 +529,7 @@ export function ViewDirectiveFill(
528529 $compile : ng . CompileService ,
529530 $controller : ng . ControllerService ,
530531 $transitions : ng . TransitionService ,
532+ $injector : ng . InjectorService ,
531533) : ng . Directive {
532534 const getControllerAs = parse ( "viewDecl.controllerAs" ) ;
533535
@@ -561,7 +563,7 @@ export function ViewDirectiveFill(
561563 } ) as Pick < ViewConfig , "viewDecl" | "getTemplate" | "controller" > &
562564 Partial < Pick < ViewConfig , "path" > > ;
563565
564- const resolveCtx = cfg . path && new ResolveContext ( cfg . path ) ;
566+ const resolveCtx = cfg . path && new ResolveContext ( cfg . path , $injector ) ;
565567
566568 $element . innerHTML =
567569 cfg . getTemplate ( $element , resolveCtx as ResolveContext ) || initial ;
@@ -618,7 +620,8 @@ export function ViewDirectiveFill(
618620 const componentName = ( cfg as ViewConfig & { component ?: string } )
619621 . component ;
620622
621- const callbackConfig = cfg as Pick < ViewConfig , "viewDecl" | "path" > ;
623+ const callbackConfig = cfg as Pick < ViewConfig , "viewDecl" | "path" > &
624+ Partial < Pick < ViewConfig , "factory" > > ;
622625
623626 if ( typeof componentName === "string" ) {
624627 const kebobName = componentName
@@ -718,7 +721,8 @@ function registerControllerCallbacks(
718721 $transitions : ng . TransitionService ,
719722 controllerInstance : ViewControllerInstance ,
720723 $scope : ng . Scope ,
721- cfg : Pick < ViewConfig , "viewDecl" | "path" > ,
724+ cfg : Pick < ViewConfig , "viewDecl" | "path" > &
725+ Partial < Pick < ViewConfig , "factory" > > ,
722726) : void {
723727 let registeredScopes = controllerRegisteredScopes . get ( controllerInstance ) ;
724728
@@ -753,7 +757,7 @@ function registerControllerCallbacks(
753757 trans : ng . Transition ,
754758 ) => void ;
755759
756- const resolveContext = new ResolveContext ( cfg . path ) ;
760+ const resolveContext = new ResolveContext ( cfg . path , cfg . factory ?. _injector ) ;
757761
758762 const viewCreationTrans = resolveContext . getResolvable ( "$transition$" )
759763 . data as ng . Transition ;
0 commit comments