-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't bind to 'matMenuTriggerFor' since it isn't a known property of 'button'. (""> #7301
Comments
Can you provide a reproduction of the issue? Based on the error you are receiving it appears that you are not importing |
It looks like you could be on an older Angular version. Can you update to 4.4.3? |
I did it fixed the error! However, now it does not like import {MatSnackBar} from '@angular/material' suggestions? |
What error are you getting? |
Module '"path/to/node_modules/@angular/material/material"' has no exported member 'MatSnackBar'. |
You should be able to import |
I thought it was called MatSnackBar with the prefix changes |
We're still in the process of renaming a lot of things. See #7241. |
So for the time being, should I be using MdSnackBar? But my module is MatSnackBarModule? |
Yes, it is a little confusing but it will be sorted out by the time we hit stable. Your IDEs autocompletion should be able to give you the proper import names. |
Okay, is MdSnackBar now considered a service? |
I dont understand why an npm package is provided that renames everything to Mat from Md, however this is not stable. This may ruin alot of peoples code. |
It does ruin a lot of code. I also though that the tool would grab what is changeable, but it seems that it converted too much (i have similar issues with Modules like mat-option not liking [value] and styles being completely off). There should be a warning about using this service. |
Closing as the issue was resolved by updating to |
getting the same issue, please help me. |
Facing same issue with newer versions of material and angular. I only face the issue running the test specs. I will upgrade these to see if it still occurs. Steps: Node: v8.9.4
|
I am experiencing the same as @Gavintek. Test Spec: `import { TestBed, async } from '@angular/core/testing'; describe('AppComponent', () => { Implementation: Karma Stack:
|
It is not sufficient to add the imports to the application module, alone. To fix this issue, add imports into any component spec beforeEach that is using the material as well. e.g: mycomponent.spec.ts MatMenuModule, MatIconModule, MatButtonModule ]` |
Thanks @DougReynolds - this works, however, it'd maybe be a bit better to update the documentation section for the API to show that more than 1 module is required for this? At the moment I've had to do the same thing with other components, but it's just trial and error at this point. Everything else has worked perfectly :) <3 |
Same problem with angular v6.1.6, i have MatMenuModule, MatIconModule, MatButtonModule and MatSnackBarModule |
@JarekSour , how did you solve it? |
Well: in the app.module.ts. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
this is for beta11
What is the expected behavior?
should bind submenu to button
What is the current behavior?
does not do that
What are the steps to reproduce?
try to bind [matMenuTriggerFor]="someSubMenu"
Providing a Plunker (or similar) is the best way to get the team to see your issue.
Plunker template: https://goo.gl/DlHd6U
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Material beta 11
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: