components icon indicating copy to clipboard operation
components copied to clipboard

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

Open tdekoekkoek opened this issue 9 years ago • 24 comments

Bug, feature request, or proposal:

I've imported MdMenu into my module and now am trying to add a menu trigger to my button

            <button md-icon-button [mdMenuTriggerFor]="menu">
                <md-icon>more_vert</md-icon>
            </button>

What is the expected behavior?

Trigger menu

What is the current behavior?

get error: Can't bind to 'mdMenuTriggerFor' since it isn't a known property of 'button'

What are the steps to reproduce?

Providing a Plunker (or similar) is the best way to get the team to see your issue. Plunker template: http://plnkr.co/edit/o077B6uEiiIgkC0S06dd

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, browsers are affected?

Is there anything else we should know?

tdekoekkoek avatar Dec 30 '16 19:12 tdekoekkoek

When errors like that appear, make sure which are the modules you imported in module which your component (with the error) is declared. In this case the missed module is the MatMenuModule.

GabrielGalatti avatar Mar 27 '19 12:03 GabrielGalatti

Uncaught Error: Template parse errors: Can't bind to 'mat-MenuTriggerData' since it isn't a known property of 'button'. (" [matMenuTriggerFor]="menu">Menu <button mat-menu-item [matMenuTriggerFor]="category" [ERROR ->][mat-MenuTriggerData]="{category: 'Starters'}">

What is solution for this

Akshaykulkarni995 avatar Apr 08 '19 07:04 Akshaykulkarni995

@Akshaykulkarni995 the solution to that is posted above by multiple people.

Splaktar avatar May 14 '19 06:05 Splaktar

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.