Skip to content

Instantly share code, notes, and snippets.

@venkateshwarv
Last active January 30, 2017 19:06
Show Gist options
  • Save venkateshwarv/c0c750069c4a48d003afcddcb1276f2a to your computer and use it in GitHub Desktop.
Save venkateshwarv/c0c750069c4a48d003afcddcb1276f2a to your computer and use it in GitHub Desktop.
import { Component, OnInit } from '@angular/core';
import { MdSnackBarRef } from '@angular/material'
@Component({
selector: 'cc-snackbar',
templateUrl: './snackbar.component.html',
styles: [
`md-icon{
cursor: pointer;
position: relative;
top: 0px;
margin-left: 10px;
}
.outer-container{
position: relative;
top: 0px;
width: calc(100% + 30px);
display: inline-block;
}
.message{
width: calc(100% - 50px);
display: inline-block;
}
.controls{
width: 40px;
display: inline-block;
height: auto;
margin-top: auto;
}
button{
height: 25px;
padding: 3px;
line-height: 20px;
}
`]
})
export class SnackbarComponent {
action: string;
message: string;
snackBarRef: MdSnackBarRef<SnackBarComponent>;
constructor() { }
ngOnInit() {
}
dismiss(){
this.snackBarRef._action();
}
get hasAction(){
return !!this.action;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment