Skip to content

fix(snackbar): don't use template string in metadata #1550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/demo-app/snack-bar/snack-bar-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,3 @@ export class SnackBarDemo {
this.snackBar.open(this.message, this.action && this.actionButtonLabel, config);
}
}


@Component({
moduleId: module.id,
selector: 'demo-snack',
templateUrl: 'snack-bar-demo.html',
styleUrls: ['./snack-bar-demo.css'],
})
export class DemoSnack {}
13 changes: 7 additions & 6 deletions src/lib/snack-bar/snack-bar-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import {
ComponentPortal,
TemplatePortal,
PortalHostDirective,
AnimationCurves,
AnimationDurations,
} from '../core';
import {MdSnackBarConfig} from './snack-bar-config';
import {MdSnackBarContentAlreadyAttached} from './snack-bar-errors';
Expand All @@ -27,6 +25,11 @@ import {Subject} from 'rxjs/Subject';

export type SnackBarState = 'initial' | 'visible' | 'complete' | 'void';

// TODO(jelbourn): we can't use constants from animation.ts here because you can't use
// a text interpolation in anything that is analyzed statically with ngc (for AoT compile).
export const SHOW_ANIMATION = '225ms cubic-bezier(0.4,0.0,1,1)';
export const HIDE_ANIMATION = '195ms cubic-bezier(0.0,0.0,0.2,1)';

/**
* Internal component that wraps user-provided snack bar content.
*/
Expand All @@ -45,10 +48,8 @@ export type SnackBarState = 'initial' | 'visible' | 'complete' | 'void';
state('initial', style({transform: 'translateY(100%)'})),
state('visible', style({transform: 'translateY(0%)'})),
state('complete', style({transform: 'translateY(100%)'})),
transition('visible => complete',
animate(`${AnimationDurations.EXITING} ${AnimationCurves.DECELERATION_CURVE}`)),
transition('initial => visible, void => visible',
animate(`${AnimationDurations.ENTERING} ${AnimationCurves.ACCELERATION_CURVE}`)),
transition('visible => complete', animate(HIDE_ANIMATION)),
transition('initial => visible, void => visible', animate(SHOW_ANIMATION)),
])
],
})
Expand Down