@@ -3,7 +3,6 @@ import {Transition} from "../transition/transition";
3
3
import { TransitionService } from "../transition/transitionService" ;
4
4
import { TransitionHookFn } from "../transition/interface" ;
5
5
import { StateDeclaration , LazyLoadResult } from "../state/interface" ;
6
- import { State } from "../state/stateObject" ;
7
6
import { services } from "../common/coreservices" ;
8
7
import { StateRule } from "../url/interface" ;
9
8
@@ -57,11 +56,11 @@ const lazyLoadHook: TransitionHookFn = (transition: Transition) => {
57
56
}
58
57
59
58
// No matching state found, so let .sync() choose the best non-state match/otherwise
60
- router . urlRouter . sync ( ) ;
59
+ router . urlService . sync ( ) ;
61
60
}
62
61
63
62
let promises = transition . entering ( )
64
- . filter ( state => ! ! state . lazyLoad )
63
+ . filter ( state => ! ! state . $$state ( ) . lazyLoad )
65
64
. map ( state => lazyLoadState ( transition , state ) ) ;
66
65
67
66
return services . $q . all ( promises ) . then ( retryTransition ) ;
@@ -79,7 +78,7 @@ export const registerLazyLoadHook = (transitionService: TransitionService) =>
79
78
* @returns A promise for the lazy load result
80
79
*/
81
80
export function lazyLoadState ( transition : Transition , state : StateDeclaration ) : Promise < LazyLoadResult > {
82
- let lazyLoadFn = state . lazyLoad ;
81
+ let lazyLoadFn = state . $$state ( ) . lazyLoad ;
83
82
84
83
// Store/get the lazy load promise on/from the hookfn so it doesn't get re-invoked
85
84
let promise = lazyLoadFn [ '_promise' ] ;
0 commit comments