Skip to content

Commit 8619cf9

Browse files
fix(view.load): Allow view.load to return synchronously
- Wrap result in a promise
1 parent 79260b6 commit 8619cf9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/hooks/views.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ import {TransitionService} from "../transition/transitionService";
1717
* In angular 1, this includes loading the templates.
1818
*/
1919
const loadEnteringViews: TransitionHookFn = (transition: Transition) => {
20+
let $q = services.$q;
2021
let enteringViews = transition.views("entering");
2122
if (!enteringViews.length) return;
22-
return services.$q.all(enteringViews.map(view => view.load())).then(noop);
23+
return $q.all(enteringViews.map(view => $q.when(view.load()))).then(noop);
2324
};
2425

2526
export const registerLoadEnteringViews = (transitionService: TransitionService) =>

0 commit comments

Comments
 (0)