0

I'm new in Angular. So I want to use the Snackbar from Angular Material Design Lite in my Project. I generated the Project with Angular-CLI and added MdlModule to my MgModule imports. i Just copy the code from the doc and get this error:

Property 'setDefaultViewContainerRef' does not exist on type 'MdlSnackbarService'.

1 Answers1

1

This is a bug in the docu (will be fixed soon). Please refer to this page for instructions: https://github.com/mseemann/angular2-mdl/wiki/How-to-use-the-MdlDialogService

you need to do this setup step in your root app component:

constructor(
    private dilalogOuletService: MdlDialogOutletService,
    private viewConatinerRef: ViewContainerRef) {
    this.dilalogOuletService.setDefaultViewContainerRef(this.viewConatinerRef);
}
michael
  • 16,221
  • 7
  • 55
  • 60