title: How to use SnackBar on service to use in every component in Angular 2
body: <p>I have a working snackbar, but it is only on each component, I want to add it on my service so I will just call it. This is my sample on my <code>component.ts</code></p>
  
  <pre class="lang-ts prettyprint-override"><code>import { MdSnackBar, MdSnackBarRef } from '@angular/material';
  ...
  export class EmployeeListComponent implements OnInit {
    public toastRef: MdSnackBarRef&lt;any&gt;;
    constructor(private _activatedRoute:ActivatedRoute,private router: Router, private http:PMISHttpService, private toast: MdSnackBar) {
  
    ngOnInit() {
      this.notify('test');
    }
    ...
    notify (text: string) {
      this.toastRef = this.toast.open(text, null);
      setTimeout(() =&gt; {
        this.toastRef.dismiss();
      }, 5000);
    }
    ...
  }
  </code></pre>