Skip to content

Commit 503677d

Browse files
committed
fix(snackbar): swap enter and exit animation curves
- Use animation constants for maintainability
1 parent c3af25b commit 503677d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/lib/snack-bar/snack-bar-container.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,16 @@ import {
3333
PortalHostDirective,
3434
} from '@angular/cdk/portal';
3535
import {first} from '@angular/cdk/rxjs';
36+
import {AnimationCurves, AnimationDurations} from '@angular/material/core';
3637
import {Observable} from 'rxjs/Observable';
3738
import {Subject} from 'rxjs/Subject';
3839
import {MatSnackBarConfig} from './snack-bar-config';
3940

4041

41-
// TODO(jelbourn): we can't use constants from animation.ts here because you can't use
42-
// a text interpolation in anything that is analyzed statically with ngc (for AoT compile).
43-
export const SHOW_ANIMATION = '225ms cubic-bezier(0.4,0.0,1,1)';
44-
export const HIDE_ANIMATION = '195ms cubic-bezier(0.0,0.0,0.2,1)';
42+
export const SHOW_ANIMATION =
43+
`${AnimationDurations.ENTERING} ${AnimationCurves.DECELERATION_CURVE}`;
44+
export const HIDE_ANIMATION =
45+
`${AnimationDurations.EXITING} ${AnimationCurves.ACCELERATION_CURVE}`;
4546

4647
/**
4748
* Internal component that wraps user-provided snack bar content.

0 commit comments

Comments
 (0)