Angular 2 Material MdSnackBar no Provider

Import MdSnackBarModule then add MdSnackBarModule inside your imports in the app.module.ts file


If you have version "@angular/material": "2.0.0-beta.12" or higher, you should import MatSnackBarModule

import {MatSnackBarModule} from '@angular/material';

// Use a more specific import if you're using "@angular/material": "8.0.0" and higher
// import {MatSnackBarModule} from '@angular/material/snack-bar';

...

@NgModule({
      imports: [
            ...
            MatSnackBarModule
          ],
    ...