Can't bind to 'matMenuTriggerFor' since it isn't a known property of 'button' Can't bind to 'matMenuTriggerFor' since it isn't a known property of 'button' angular angular

Can't bind to 'matMenuTriggerFor' since it isn't a known property of 'button'


Import MatMenuModule in your feature Module OR the Module where this component resides in.

 import { MatMenuModule} from '@angular/material/menu';

and

imports: [  MatMenuModule]


I think you need to add the MatMenuModule import to your app.module file.


Random but in case someone was searching like me: I was importing a custom angular material library and building the consuming library before building the material library. when I built the material library first then the consuming library was about to see the MatMenuModule and errors went away.

I changed

"library:build": "npm run ng7-common:build" && npm run ng8-material:build

to:

"library:build": " npm run ng8-material:build && npm run ng7-common:build"