'md-option' is not a known element
See original GitHub issueBug, feature request, or proposal:
Bug (or wrong usage?)
What is the expected behavior?
Options should be displayed within the select element.
What is the current behavior?
The whole application does not render
What are the steps to reproduce?
Tried to reproduce it with a plunkr, was happy when i edited your template and saw i got the same error. after opening and verifying it in a new private window the error disappeared. So i assumed it could be a client cache problem, but after retrying with different browsers i still get not managed this problem.
Which versions of Angular, Material, OS, browsers are affected?
I am using Material 2.0.0-alpha.11-3 with Angular 2.2.4
Is there anything else we should know?
I am using Angular-CLI
Unhandled Promise rejection: Template parse errors:
'md-option' is not a known element:
1. If 'md-option' is an Angular component, then verify that it is part of this module.
2. If 'md-option' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("h2>User hinzufügen</h2>
<md-select [(ngModel)]="aUserId" name="user" placeholder="User">
[ERROR ->]<md-option *ngFor="let item of aUser" value="5">{{item.firstname}} {{item.lastname}}</md-option>
<"): MyComponent@17:6
TemplateParser</TemplateParser.prototype.parse@http://localhost:4200/vendor.bundle.js:18368:19 [<root>]
RuntimeCompiler</RuntimeCompiler.prototype._compileTemplate@http://localhost:4200/vendor.bundle.js:40389:30 [<root>]
RuntimeCompiler</RuntimeCompiler.prototype._compileComponents/<@http://localhost:4200/vendor.bundle.js:40309:56 [<root>]
RuntimeCompiler</RuntimeCompiler.prototype._compileComponents@http://localhost:4200/vendor.bundle.js:40309:9 [<root>]
RuntimeCompiler</RuntimeCompiler.prototype._compileModuleAndComponents/createResult@http://localhost:4200/vendor.bundle.js:40205:13 [<root>]
Zone$1</Zone</Zone.prototype.run@http://localhost:4200/vendor.bundle.js:95823:24 [<root> => <root>]
scheduleResolveOrReject/<@http://localhost:4200/vendor.bundle.js:96219:52 [<root>]
Zone$1</Zone</Zone.prototype.runTask@http://localhost:4200/vendor.bundle.js:95861:28 [<root> => <root>]
drainMicroTaskQueue@http://localhost:4200/vendor.bundle.js:96115:25 [<root>]
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:18 (2 by maintainers)
Top Results From Across the Web
Angular Material component not working: 'mat-option' is not a ...
Uncaught Error: Template parse errors: 'mat-option' is not a known element: // ... I think the error comes from app.module.ts : import { ......
Read more >'ng-option' is not a known element: - You.com | The AI Search ...
Unhandled Promise rejection: Template parse errors: 'md-option' is not a known element: 1. If 'md-option' is an Angular component, then verify that it...
Read more >angular material grid example
ERROR in : 'mat-grid-tile' is not a known element: 1. ... If 'md-option' is an Angular component, then verify that it is part...
Read more >Directives > mdSelect - AngularJS Material
Parameter Type Description
* ng‑model expression expression Assignable angular expression to data‑bind to.
placeholder string string Placeholder hint text.
Read more >angular/material2 - Gitter
ngFor is also fine? _. Can't bind to 'ngValue' since it isn't a known property of 'md-option' ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Started working after adding import { MaterialModule } from ‘@angular/material’; import { MdSelectModule } from ‘@angular/material’;
and importing it to array like below on the same module as where the form is. If added to app.module.ts it was still giving error
imports: [ BrowserModule, FormsModule, HttpModule, MaterialModule, MdSelectModule ],
I had to import the MdSelectModule separate to the MaterialModule to get it to work.