Skip to content

Instantly share code, notes, and snippets.

@Dssdiego
Created April 24, 2019 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dssdiego/dcb466ebc48cdf5ff6f11f181a23d51e to your computer and use it in GitHub Desktop.
Save Dssdiego/dcb466ebc48cdf5ff6f11f181a23d51e to your computer and use it in GitHub Desktop.
import { Component, OnInit } from '@angular/core';
import { MatSnackBar } from '@angular/material';
@Component({
selector: 'app-toast',
templateUrl: './toast.component.html',
styleUrls: ['./toast.component.scss']
})
export class Toast implements OnInit {
constructor(
private snackBar: MatSnackBar
) { }
ngOnInit() {
this.snackBar.open('Product added to cart', 'OK', { duration: 4000 });
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment