0

currently I have a problem with one angular 6 App. I use the Fuse Skeleton Template for it. Currently I'm getting trouble, when I try to use MatSnackBar in the App. As soon as I add the MatSnackBar to the constructor of a component, I get an Error in the JS Console of the Browser.

  constructor(
    private formBuilder: FormBuilder,
    private location: Location,
    public snackBar: MatSnackBar
  )
  {

  }

And this is the Error message:

ERROR Error: "[object Object]"

How can I get more Information what is wrong?

user39063
  • 183
  • 1
  • 13

2 Answers2

0

You need to import MatSnackBarModule in app.module.ts array.

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

imports: [ ... MatSnackBarModule ...

Without it, I get an error just like you

To debug, if you have access to the imported source code(and use vscode), follow this instructions, put a break point on the constructor of the imported class.

You could also put a debugger and open the Developer tools(F12 in chrome):

foo() { 
   debugger; 
   console.log('footest');
}

Hope it helps!

Ricardo Rocha
  • 14,612
  • 20
  • 74
  • 130
Gustavo
  • 126
  • 9
0

There is a open source plugin available for google chrome, So you can use the AngularJS Batarang

chrome plugin for debug AngularJS

Ram Neduri
  • 448
  • 5
  • 7