Skip to content

Commit ca281f2

Browse files
committed
fix(animations): fix dynamic animations in prod build, fixes #71
1 parent 1e232f1 commit ca281f2

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/app/core/animations/router.transition.ts

+12-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111

1212
export const ANIMATE_ON_ROUTE_ENTER = 'route-enter-staggered';
1313

14-
const ROUTE_TRANSITION_STEPS: any[] = [
14+
const ROUTE_TRANSITION: any[] = [
1515
query(':enter > *', style({ opacity: 0, position: 'fixed' }), {
1616
optional: true
1717
}),
@@ -60,12 +60,17 @@ const ROUTE_TRANSITION_STEPS: any[] = [
6060
)
6161
];
6262

63-
// disable whole page slide-in animation in IE and EDGE
64-
if (['ie', 'edge'].includes(browser().name)) {
65-
ROUTE_TRANSITION_STEPS.splice(0, 1);
66-
ROUTE_TRANSITION_STEPS.splice(1, 1);
67-
}
63+
export const ROUTE_TRANSITION_IE = [ROUTE_TRANSITION[1], ROUTE_TRANSITION[3]];
6864

6965
export const routerTransition = trigger('routerTransition', [
70-
transition('* <=> *', ROUTE_TRANSITION_STEPS)
66+
transition(isNotIEorEdge, ROUTE_TRANSITION),
67+
transition(isIEorEdge, ROUTE_TRANSITION_IE)
7168
]);
69+
70+
export function isNotIEorEdge() {
71+
return !isIEorEdge();
72+
}
73+
74+
export function isIEorEdge() {
75+
return ['ie', 'edge'].includes(browser().name);
76+
}

0 commit comments

Comments
 (0)